Hi All,
Sorting of records in ExtJS 5.0
We are currently migrating our project from ExtJS 3.4 to ExtJS 5.4, I have methods which sort the selected records by sortIndex like below.
sort: function (store, selection, offset) {
if (selection.length === 1) {
selection[0].sortIndex = store.indexOf(selection[0]);
} else {
selection.sort(function (a, b) {
if (!a.sortIndex) {
a.sortIndex = store.indexOf(a);
}
if (!b.sortIndex) {
b.sortIndex = store.indexOf(b);
}
if (a.sortIndex > b.sortIndex) {
return offset * -1;
} else {
return a.sortIndex === b.sortIndex ? 0 : offset;
}
});
}
}
In ExtJS 5.4(latest version) Ext.Data.Record/Model doesn't have the property called - sortIndex. So could you please let me know how do I achieve the same in ExtJS 5.4?
Thanks in Advance.
Best Regards,
Sathish
Sorting of records in ExtJS 5.0
Aucun commentaire:
Enregistrer un commentaire