سؤال

i am working in extjs4. I have gridview with cellEditing plugin used.Its working correctly. But after editing foldername its not showing newly updated name of folder on grid. I don't want to refresh store. i just want to show updated name on grid. I have tried as=

getGridPanelStore = getGridPanel.getStore();
folderId = id;
var newtitle = newUpdatedValue;
getRecord = getGridPanelStore.getById(id);
recordToUpdate = getGridPanelStore.indexOf(getRecord ).set('title',newtitle );

But it not setting new updated value on grid. So how to show updated value on grid after editing without loading whole store.

هل كانت مفيدة؟

المحلول

Does this code actually work?

As far as I understand the method indexOf of Ext.data.Store retrieves the index of the record inside the store as an integer thus calling set('title', newTitle) probably will raise an exception of the type Uncaught TypeError: Object n has no method 'set'

Besides that you don't need to load the whole store to get your grid updated, since views are bound to the stores they auto refresh anytime a store field changes, so it should work by changing the title property as follows:

gridStore = gridPanel.getStore();
record = gridStore.getById(recordId);
record.set('title', newTitle);

If value doesn't update that way, you should check if the target column doesn't have a custom renderer associated to it that can be changing the view output for that specific field in any way.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top