I want to implement a dynamic column in grid panel, how can I do it? I used Extjs 4.0.7:
var result = Ext.JSON.decode(response.responseText);
store.model.setFields(result.fields);
grid.reconfigure(store, result.columns);
store.loadRawData(result.data, false);
The method setFields() doesn't exist in version 4.0.7
Try something like :
var store = new Ext.data.Store({fields: result.fields, data: result.data})
grid.reconfigure(store, result.columns})
The fields config on Store has always behaved this way, with the ability to pass in fields instead of a model. http://docs.sencha.com/ext-js/4-1/#!/api/Ext.data.AbstractStore-cfg-fields
Related
I tried to automate Dynamics365 using Selenium, but facing a lot of issues like
Used 'Id' as element locator, but it keeps changing on different instances
Element locator 'Name' is not working in all instances
Xpath came with appending 'id', so it is also dynamic
Due to all these i cant able to run the code in IE,but the code is working in Chrome.
Can someone help with the issue?
I recommend you look into using EasyRepro. It is a C# project from MS in Github that is built on top of Selenium and is a framework that lets you focus on writing meaningful tests instead of learning Selenium and the complicated DOM in D365. It allows you refer to the form objects by the schema name. When you download the project, it is loaded with tons of great examples that you can run to test all different forms and you can modify them to meet your needs.
For example, you can test creating a contact using easy code like this:
xrmBrowser.LoginPage.Login(_xrmUri, _username, _password);
xrmBrowser.GuidedHelp.CloseGuidedHelp();
xrmBrowser.ThinkTime(500);
xrmBrowser.Navigation.OpenSubArea("Sales", "Contacts");
xrmBrowser.ThinkTime(1000);
xrmBrowser.Grid.SwitchView("Active Contacts");
xrmBrowser.ThinkTime(2000);
xrmBrowser.CommandBar.ClickCommand("New");
xrmBrowser.ThinkTime(5000);
var fields = new List<Field>
{
new Field() {Id = "firstname", Value = "Test"},
new Field() {Id = "lastname", Value = "Contact"}
};
xrmBrowser.Entity.SetValue(new CompositeControl() { Id = "fullname", Fields = fields});
xrmBrowser.Entity.SetValue("emailaddress1", "test#contoso.com");
xrmBrowser.Entity.SetValue("mobilephone", "555-555-5555");
xrmBrowser.Entity.SetValue("birthdate", DateTime.Parse("11/1/1980"));
xrmBrowser.Entity.SetValue(new OptionSet { Name = "preferredcontactmethodcode", Value = "Email"});
xrmBrowser.CommandBar.ClickCommand("Save");
Just getting started with dojo/JsonRest, but having some problems with sending updates back to my server. I've got 2 questions that I'm stuck with;
The code below produces a grid with one of the columns set to editable.
The primary key in my json data is the "jobName" attribute (hence idAttribute in the JsonRest store).
First question is about the URI in the PUT;
- When I call dataStore.save() the server get's a PUT, but the URI is /myrestservice/Jobs/0.9877865987 (it changes each time, but is always a float)
- I don't see where dojo is getting the float number from? It's not my idAttribute value from that row. How can I get the PUT to respect the idAttribute in the JsonRest store?
- I did try setting idProperty in the MemoryStore to "jobName", but that changed the PUT in to a POST and removed the float, but I still don't get a jobName in the URI which is what my REST server needs.
Second question about the content of the PUT;
- The PUT contains the whole row. I'd really just like the idAttribute and the data that changed - is that possible?
I've been through the examples and docs, but there aren't many examples of handling the PUT/POST part of JsonRest.
Thanks
var userMemoryStore = new dojo.store.Memory( );
var userJsonRestStore = new dojo.store.JsonRest({target:"/myrestservice/Jobs/", idAttribute:"jobName"});
var jsonStore = new dojo.store.Cache(userJsonRestStore, userMemoryStore);
var dataStore = new dojo.data.ObjectStore( {objectStore: jsonStore } );
/*create a new grid*/
var grid = new dojox.grid.DataGrid({
id: 'grid'
,store: dataStore
,structure: layout
,rowSelector: '20px'}
,"gridDiv");
grid.startup();
dojo.query("#save").onclick(function() {
dataStore.save();
});
I think you want idProperty, not idAttribute. It also might help to set idProperty in the Memory store being used to cache as well; that may be what's generating the random float.
As for the second question, that'd probably require customization; I don't believe OOTB stores (or grids) generally expect to send partial items.
I am looking to get all projects under a selected project (i.e the entire child project branch ) using Wsapi data store query in Rally SDK 2.0rc1. Is it possible using a query to recursively get all child project names? or will I have to write a separate recursive function to get that information? If a separate recursive function is required, how should I populate that data into for example, a combo box? Do I need to create a separate data store and push the data from my recursive function in it and then link the Combobox's store to it?
Also, how to get the "current workspace name" (workspace that I am working in, inside Rally), in Rally SDK 2.0rc1 ?
Use the 'context' config option to specify which project level to start at and add 'projectScopeDown' to make sure child projects are returned. That would look something like this:
Ext.create('Rally.data.WsapiDataStore', {
limit : Infinity,
model : 'Project',
fetch : ['Name','ObjectID'],
context : {
project : '/project/' + PROJECT_OID,
projectScopeDown : true
}
}).load({
callback: function(store) {
//Use project store data here
}
});
To get your current context data, use: this.getContext().
var workspace = this.getContext().getWorkspace();
var project = this.getContext().getProject();
If you try exposing with console.log the this.getContext().getWorkspace() and this.getContext().getProject() you may understand better what is returned and what is required. In one of my cases I had to use this.getContext().getProject().project.
Using console debug statement is best way to figure what you need based on its usage.
Could someone tell me how to query allowed values of an attribute in Rally using javascript?
Particularly, I want to query all possible states of a Defect
I know that it can be done with REST api
DynamicJsonObject allowedValues = restApi.GetAllowedAttributeValues("defect", "state");
Is there a javascript equivalence?
You can use RallyDataSource from the App SDK (note, this is the original one, not the new ExtJS-based SDK currently in preview). See the Attribute Values example on this page:
http://developer.rallydev.com/help/data-examples
You may wish to try something along the lines of:
queryConfig = {
type: 'Defect',
key : 'defectStates',
attribute: 'State'
};
I am a beginner to sencha Touch, basically i am a blackberry developer. Currently we are migrating our application to support Sencha Touch 1.1. Now i have some business solutions like i want to store the selected values in the local database. I mean i have multiple screens where, Once the user selects a value in each of the screen the data should save in the below following format.
[{'key1': "value1", 'key2': "value2", 'key3': "value3" ,'key4': "value4", 'key5': "value5"}]
1. First, the values need to be saved in key value pairs
2. The keys should play the role of primary key, key shouldn't be duplicated.
3. Should be available till the application life cycle or application session, don't need to save the data permanently.
I have come across the concepts like LocalStorageProxy, JsonStore and some others. I don't understand which one i can use for my specific requirements.
May be my question is bit more confusing. I have achieved the same using vector, in Blackberry Java so any data structure similar to this could help me. Need the basic operations like
Create
Add
Remove
Remove all
Fetch elements based on key
Please suggest me some samples or some code snapshots, which may help me to achieve this.
Edit: 1
I have done the changes as per #Ilya139 's answer. Now I am able to add the data with key,
// this is my Object declared in App.js
NSDictionary: {},
// adding the data to object with key
MyApp.NSDictionary['PROD'] = 'SONY JUKE BOX';
//trying to retrieve the elements from vector
var prod = MyApp.NSDictionary['PROD'];
Nut not able to retrieve the elements using the above syntax.
If you don't need to save the data permanently then you can just have a global object with the properties you need. First define the object like this:
new Ext.Application({
name: 'MyApp',
vectorYouNeed: {},
launch: function () { ...
Then add the key-value pairs to the object like this
MyApp.vectorYouNeed[key] = value;
And fetch them like this
value = MyApp.vectorYouNeed[key];
Note that key is a string object i.e. var key='key1'; and value can be any type of object.
To remove one value MyApp.vectorYouNeed[key] = null; And to remove all of them MyApp.vectorYouNeed = {};