0
Как передать идентификатор из сетки в модель? вот мой код сетки панели:ext js 6 пропустить динамический идентификатор от сетки до модели
{
text : 'Tindakan',
xtype: 'actioncolumn',
minWidth: 130,
sortable: false,
menuDisabled: true,
items: [{
icon: 'images/view.png', // Use a URL in the icon config
tooltip: 'Lihat',
handler : function(grid, rowIndex, colIndex) {
var rec = grid.getStore().getAt(rowIndex);
alert("Lihat - " + rec.get('id'));
}]
}
Вот мой код модели:
Ext.define('Kds.model.ProfilView', {
extend: 'Ext.data.Store',
alias: 'model.profilView',
fields: [
'name',
'ic_no',
'address',
],
pageSize : 20,
proxy: {
type: 'rest',
url : 'http://localhost/kds-rest/web/index.php/people/view/'+id,
useDefaultXhrHeader : false,
withCredentials: false,
reader: {
type: 'json',
rootProperty: 'data',
//totalProperty: 'totalItems'
}
},
autoLoad: 'true',
});
я попробовать, но получить эту ошибку в консоли: HTTP : //localhost/kds-rest/web/index.php/people/view/undefined? 404 (не найдено) –
Отредактировано мое сообщение, еще раз проверьте пожалуйста. –
все еще возвращает ту же ошибку –