extjs - load store with dynamic param -
I want to load a record based on my tree node selection and show it in my form. But my store is not loaded in my controller handler How should I load the store with my parameters?
var me = this; Var idTag = me.getMyNode (); Me.getTagStore () On ('beforeload', function (store, operations, eOpts) {operation.params = {idTag: idTag};}, me); // it will not be loaded here and let me rec = unchanged var rec = me.getTagStore () Load (). GetAt (0); . Me.getMyForm () loadRecord (REC); And this is my store:
Ext.define ('TTT.store.Tag', {extension: 'Ext.data.Store', Required to: ['ttm.model.ag'], model: 'ttt.modeltag', proxy: {type: 'ajax', url: 'tag / search.jason', reader: {type: 'jason' Root: 'data'}}, premise: {idTag: 30},});
You can call the load method manually when you need it and You can pass any of the parameters like:
me.getTagStore (). Load ({params: {idTag: idTag}}); When you call it, you should see your request with parameters in the browser in your console window.
In your code above, this line:
// it will not load here and I get RE = unchanged var rec = me.getTagStore (). Load (). GetAt (0); Load operation takes a little longer, but not more, but it takes a little while. You need to listen to the load event on your store to be able to work in this way, here This is an example:
me.getTagStore (). Load ({params: {idTag: idTag}, scope: this, callback: functions (records, operations, success) {// Operation Object // load operation console. Contains all the details of the log (record);}}) ; Check the document for .
Comments
Post a Comment