परिदृश्यExtJS
में एक रिकॉर्ड में एक क्षेत्र अपडेट कर रहा है dyanamically मैं स्थिर डेटा के साथ ग्रिड की दुकान होने में विशेष रिकॉर्ड के स्तंभ डेटा अपडेट करना चाहते हैं। यहाँ मेरी दुकान है:
extend : 'Ext.data.Store',
model : 'MyModel',
autoLoad:true,
proxy: {
type: 'ajax',
url: 'app/data/data.json',
reader: {
type: 'json',
root: 'users'
}
},
मेरे data.json
{
'users': [{
QMgrStatus: "active",
QMgrName: 'R01QN00_LQYV',
ChannelStatus: 'active',
ChannelName: 'LQYV.L.CLNT',
MxConn: 50
}]
}
मैं रिकॉर्ड को अपडेट करने क्या कर रहा हूँ:
var grid = Ext.getCmp('MyGrid');
var store = Ext.getStore('Mystore');
store.each(function(record, idx) {
val = record.get('ChannelName');
if (val == "LQYV.L.CLNT") {
record.set('ChannelStatus', 'inactive');
record.commit();
}
});
console.log(store);
grid.getView().refresh();
मेरी समस्या
मुझे यहां रिकॉर्ड अपडेट हो रहा है। यह मेरे ग्रिड पैनल में दिखाई नहीं दे रहा है। ग्रिड एक ही पुराने स्टोर (स्थिर) का उपयोग कर रहा है। क्या स्थिर डेटा की समस्या है? या क्या मुझे कुछ याद आ रहा है या कहीं गलत हो रहा है? कृपया इस मुद्दे के साथ मेरी मदद करें। बहुत धन्यवाद।
मेरे संपादन
मैं रंग कोड को status.But के आधार पर यहाँ मैं हमेशा हो रही है स्तंभ tryng हूँ स्थिति = "सक्रिय" भले ही मैं दुकान को अद्यतन करने कर रहा हूँ।
मैं अपने ग्रिड में करने के लिए कोशिश कर रहा हूँ क्या
{
xtype: 'grid',
itemId: 'InterfaceQueueGrid',
id: 'MyGrid',
store: 'Mytore',
height: 216,
width: 600,
columns: [{
text: 'QueueMgr Status',
dataIndex: 'QMgrStatus',
width: 80
}, {
text: 'Queue Manager \n Name',
dataIndex: 'QMgrName',
width: 138
}, {
text: 'Channel Status',
dataIndex: 'ChannelStatus',
width: 78,
align: 'center',
renderer: function(value, meta, record) {
var val = record.get('ChannelStatus');
console.log(val); // Here I am always getting status="active".
if (val == 'inactive') {
return '<img src="redIcon.png"/>';
} else if (val == 'active') {
return '<img src="greenIcon.png"/>';
}
}
}, {
text: 'Channel Name',
align: 'center',
dataIndex: 'ChannelName',
width: 80
} {
text: 'Max Connections',
align: 'center',
dataIndex: 'MxConn',
width: 80
}]
}
धन्यवाद क्रिस्टोफ। मैंने इसे grid.bindStore (MyUpdatedStore) का उपयोग करके हल किया; लेकिन आपका समाधान भी चट्टानों। बहुत धन्यवाद – Dev
प्रयुक्त grid.reconfigure (स्टोर) - एक आकर्षण की तरह काम किया! धन्यवाद! –