i am trying to follow this example here :http://www.sencha.com/forum/showthread.php?11735-How-can-I-ADD-to-baseParams-rather-than-overwrite-one-set-of-baseParams-with-another
The objective is to add parameters to your baseparams dynamically.
But when I submit request, I cannot see the parametrs added. What am I missing?
Every class extending Ext.data.Store has a setBaseParam() method that can be used for that.
If your store is for example in variable called store you do
store.setBaseParam('someParameter','value');
Probably the most common usage is in grids
grid.getStore().setBaseParam('someParameter','value');
similarily in remote comboboxes
comboBox.getStore().setBaseParam('someParameter','value');
for ExtJS4 you should do
comboBox.getStore().getProxy().extraParams.someParam = 'someValue'
Related
I declare one grid in extjs 3.4. I am using ajax call and on success function I am getting column and data. How will I use this data as a store in grid.
Thanks for help.
You can use Ext.data.XmlStore and can refer docs to configure it.
http://docs.sencha.com/extjs/3.4.0/#!/api/Ext.data.XmlStore
I'm using the server side pagination and filtering example with angularjs.
On loading the data in grid, I would like to programmatically set the first row.
However below method does not work if the grid data has been set using data source.
$scope.gridOptions.api.selectIndex
doesn't work with datasource.
It only works after using the $scope.gridOptions.api.setDataSource
I've also opened an issue in github. Below is the link:
https://github.com/ceolter/ag-grid/issues/601
Please help in resolving this issue.
This is to be expected.
The datasource is the object that will provide your server's data.
As long the datasource is not loaded and did not load the 1st datas you can't use selectIndex method since there is nothing to select.
As a workaround i add myself a custom option in gridOptions where you can provide what you want to select at the 1st loading and select them once my data are loaded the 1st time in my datasource. I add another callback to be able to compare datas and another when the data is not found.
If you want something simplier you can pass to your datasource a promise that will be resolved once the 1st data get loaded (resolve it after call params.successCallback(data) !)
Note : the callback params.successCallback(data) to send the new data to the grid from the datasource must be called before using selectIndex whatever the solution you use.
A grid is configured with a store that use a model that I can call modelA
I need to change on the fly the model of the store related to the grid.
I followed following approach without results:
grid.getStore().setModel(modelB);
grid.reconfigure(
grid.getStore(),
columns
);
grid.getStore().load();
It continues to use the model defined at the beginning. In fact if I debug the record that is passed to the renderer function as follows:
function(value, metadata, record)...
record continues to reference modelA instead of modelB.
How can I change dynamically the model of the store?
I think that although you set new model you haven't re-read the records, at least you do not show any store.load() call. Models are used by store/proxy/reader to create instances when the store is loaded.
Now, I wouldn't use this approach anyway. Store is not a very expensive in terms of performance or memory so if I'd need to reconfigure the grid I'd use another store with that another model.
To achieve this task, you can change fields of model dynamically instead of changing the model itself. Sample fiddle
store.model.setFields(fieldsArray);
store.load(); // or store.load(newData);
grid.reconfigure(store,columnInfo);
Hope this helps.
Im new to extjs,I need to pass a xml(xml data thats loading grid),and start value,and limit.How can I do this in 'store.load'???
I actually need to display data in grid,with current pagenumber,and with limit.
Is there a way???plz help
You just need to setup a page size and then use store.loadPage() method.
Bear in mind there is a nice paging toolbar for data grid integrated in ExtJS
I am trying to load/show completely different set of values in a combobox(this one resides as a editor within an EditorGridPanel) based on the valueField of another combobox(this one resides outside the grid in top bar). I have already seen a tutorial(http://www.extjs.com/learn/Tutorial%3ALinked%5FCombos%5FTutorial%5Ffor%5FExt%5F2) wherein ALL the values for the secondary object are stored locally and then filtered however, I have already created a link which will supply me with json data based on the valuefield, so I would like to use this url to keep the code efficient.
I have also tried to refresh the datastore but its simply not being reflected on the combobox.
Please advise
Thanks
Found the solution, loading values from a url is straightforward.. if you want to manipulate the query(like I wanted), you would have to strip url off the dynamic parameters and assign them to baseParams of the store and then call store.load()
It worked for me!!