-
19 Feb 2009 8:16 PM #1
How to tell the value has been updated in PropertyGrid
How to tell the value has been updated in PropertyGrid
How can I tell the values in PropertyGrid have been updated?
My propertyGrid is loaded in my code like this:
var rec = new Grid.PropertyRecord({
name: 'abc',
value: '123'
});
propertyPanel.store.add(rec);
After I change the value, both propertyPanel.store.getAt(0).dirty and propertyPanel.store.isModified('abc') still returns false.
I added propertyPanel.store.commitChanges(); before I query dirty and isModified. Still returns false here.
Is there an easy way to tell the value has been modified? Or do I use PropertyPanel wrong?
TIA!
Gang
-
20 Feb 2009 3:55 AM #2
Post some code that makes sense. What is propertyPanel?
Post a working showcase
http://extjs.com/learn/Ext_Forum_Hel...rking_showcaseMJ
API Search || Ext 3: docs-demo-upgrade guide || User Extension Repository
Frequently Asked Questions: FAQs
Tutorial: Grid (php/mysql/json) , Application Design and Structure || Extensions: MetaGrid, MessageWindow
-
20 Feb 2009 7:52 AM #3
Sorry, I really mean PropertyGrid, not PropertyPanel. Newbie here.
Here is a simple code I have here.
-
20 Feb 2009 8:58 AM #4
Just paste the code inside code tags please, don't attach.
MJ
API Search || Ext 3: docs-demo-upgrade guide || User Extension Repository
Frequently Asked Questions: FAQs
Tutorial: Grid (php/mysql/json) , Application Design and Structure || Extensions: MetaGrid, MessageWindow
-
20 Feb 2009 9:51 AM #5
Here it is. Sorry about it.
The code shows how the PropertyGrid is populated. When the values are updated, is there an easy way to tell?
Code:<html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title id='title'>Title</title> <!-- ** CSS ** --> <!-- base library --> <link rel="stylesheet" type="text/css" href="../../resources/css/ext-all.css" /> <!-- overrides to base library --> <!-- ** Javascript ** --> <!-- base library --> <script type="text/javascript" src="../../adapter/ext/ext-base.js"></script> <script type="text/javascript" src="../../ext-all-debug.js"></script> <!-- overrides to base library --> <!-- extensions --> <!-- page specific --> <script type="text/javascript"> Ext.BLANK_IMAGE_URL = '../../resources/images/default/s.gif'; Ext.onReady(function(){ //your onReady code here var propPanel = new Ext.grid.PropertyGrid({ id: 'prop_grid', title: 'Setting Grid', margins: '5 5 5 1', stripeRows: true, renderTo: 'grid-example', width: 400, height: 300, source: {} }); // Disable sorting of the propertyGrid propPanel.getColumnModel().setConfig([ {header: 'Attribute', sortable: false, dataIndex: 'name', id:'name'}, {header: 'Value', sortable: false, dataIndex: 'value', id:'value'} ]); var rec = new Ext.grid.PropertyRecord({ name: 'Field1', value: '123' }); propPanel.store.add(rec); rec = new Ext.grid.PropertyRecord({ name: 'Field2', value: '456' }); propPanel.store.add(rec); }); //end onReady </script> </head> <body> <div id="grid-example"></div> </body> </html>


Reply With Quote