Я реализовал разбиение на страницы в ext Js, но после этого моя сетка не может заполняться данными, я также проверил на стороне сервера, которая работает нормально, В консоли есть ошибка EXT JS TypeError: 'undefined' is not an object (evaluating 'e.length')
isстолкнулся с которым я не смог разобраться, помогите пожалуйста избавиться от этого, фрагмент ниже.
var smstore;
var smGridRecord;
var smeditor;
var smlayout;
var smgrid;
var addmemberlist;
function searchMember(holdingId){
var searchMemberText = document.getElementById("searchMemberText").value;
var memberCountry = document.getElementById("memberCountry").value;
var memberType = document.getElementById("memberType").value;
var searchmember = document.getElementById("searchmember");
searchmember.innerHTML = '';
smstore = Ext.data.Record.create(
[
{name: 'accountId',type: 'string'},
{name: 'externalReferenceID',type: 'string'},
{name: 'name',type: 'string'},
{name: 'countryName',type: 'string'},
{name: 'membercategory',type: 'string'},
{name: 'membershipId',type: 'string'},
{name: 'isPartOfHolding',type: 'string'},
{name: 'isPartOfSameHolding',type: 'string'}
]
);
addmemberlist = new Ext.data.GroupingStore({
root: 'data',
totalProperty: 'totalCount',
autoLoad : true,
reader: new Ext.data.JsonReader({fields: smstore}),
sortInfo: {field: 'name', direction: 'ASC'},
remoteSort: true,
scripts: true,
url: 'holdingMembersData.action?coreProductId=<s:property value="coreProductId" />&searchText=' +
encodeURIComponent(searchMemberText) + '&memberCountry=' + memberCountry +'&memberType=' + memberType +
'&holdingId=' + holdingId,
});
var myval = 50;
smgrid = new Ext.grid.GridPanel({
store: addmemberlist,
loadMask:true,
width: '100%',
height: 400,
bodyBorder:false,
region:'center',
renderTo: 'searchmember',
enableColumnMove:true,
stateful: true,
stateId: 'searchMemberGrid',
margins: '0 5 5 5',
columns:
[
{
header:'Select',
width:20,
align: 'left',
menuDisabled: true,
renderer: createcheckbox
},{
header:'Member Name',
dataIndex: 'name',
width: 100,
align: 'left',
sortable: true,
menuDisabled: false,
renderer:memberNameRenderer
},
{
id: 'membershipId',
header:'Member ID',
dataIndex: 'membershipId',
width: 80,
align: 'left',
sortable: true,
menuDisabled: false
},{
header:'Member Type',
dataIndex: 'membercategory',
width: 100,
align: 'left',
sortable: true,
menuDisabled: false
},{
header:'Member Country',
dataIndex: 'countryName',
width: 80,
align: 'left',
sortable: true,
menuDisabled: false
}
],
viewConfig: {
forceFit:true,
enableRowBody:false,
showPreview:false,
scrollOffset:0
},
bbar: new Ext.PagingToolbar({
pageSize: myval,
store: addmemberlist ,
emptyMsg: "No topics to display",
layoutConfig:{
onLayout: alignPagingToolbar
}
})
});
console.log("HERE-----------------");
addmemberlist.load({params:{start:0, limit:myval}});
smgrid.render("searchmember");
console.log("AFTER RENDER");
}
function alignPagingToolbar(ct, target){
console.log("INSIDE ALIGN PagingToolbar");
if(!this.leftTr){
target.addClass('x-toolbar-layout-ct');
target.insertHtml('beforeEnd',
'<table cellspacing="0" class="x-toolbar-ct"><tbody><tr><td class="x-toolbar-left" align="left"><table cellspacing="0" align="right"><tbody><tr class="x-toolbar-left-row"></tr></tbody></table></td><td class="x-toolbar-right" align="right"><table cellspacing="0" class="x-toolbar-right-ct"><tbody><tr><td><table cellspacing="0"><tbody><tr class="x-toolbar-right-row"></tr></tbody></table></td><td><table cellspacing="0"><tbody><tr class="x-toolbar-extras-row"></tr></tbody></table></td></tr></tbody></table></td></tr></tbody></table>');
this.leftTr = target.child('tr.x-toolbar-left-row', true);
this.rightTr = target.child('tr.x-toolbar-right-row', true);
this.extrasTr = target.child('tr.x-toolbar-extras-row', true);
}
this.constructor.prototype.onLayout.call(this, ct, target);
}