PDA

View Full Version : How to access grid's object that has been trasformed into a class



sajan
26 Jul 2010, 2:17 AM
Dear all,
I transformed my Grid (previously it was on a window) to a class. The grid's toolbar had button to it.
So after transferring it to a class I am starting to get undefined error( from the window.js page). I have code that has to disable that button on certain condition, so please guide how to disable it from window.js page

thanks is advance

jarrednicholls
26 Jul 2010, 5:27 AM
Hi sajan,

Does the Grid instance still have its autoRef specified in the Window?

sajan
26 Jul 2010, 6:39 AM
Yes it does have auto ref still attached to it but then also it is showing undefined error.
thanks

jarrednicholls
26 Jul 2010, 6:55 AM
Ok, can you attach your project file? I can take a look for you. Thanks.

sajan
26 Jul 2010, 7:06 AM
Thanks Jarred,
I did something like this and it worked

this.QuoteLineGrid.QLDuplicateRef.disable();
QuoteLineGrid:= this is the grid it has its auto ref set on the "window.js file" as
ref: 'QuoteLineGrid',
xtype: 'myeditorgrid'

auto ref of the button is QLDuplicateRef

so am I 100 % correct or this technique will just work ;)

In the similar way can I disable "editor grid" plugin. Please do let me know.
thanks

jarrednicholls
26 Jul 2010, 7:25 AM
Hey sajan,

Yeah that's what you needed to do, access the Grid and then in turn access the Button. Since the Grid is a class of its own, the auto ref for the Button will only take the button's reference up to the Grid, not up to the Window. Thus you just need to do a chain reference.

What do you mean, disable the editor grid plugin? Are you talking about disabling the ability to edit? I thought I answered the question in this thread: http://www.sencha.com/forum/showthread.php?103971-Udating-Grid-from-Editable-to-simple-grid-and-vice-versa-on-the-fly&p=487963#post487963

Thanks.

sajan
26 Jul 2010, 8:07 AM
Hi Jarred,
I meant to disable the "Editor Grid Plugins" feature.
When clicked from A button it should activate that feature /plugin
when clicked from B button it should not run that feature.

This is desired because after disabling the editor grid then also it shows "save" and "cancel" button that is showed inside the grid becuse of the plugin.


So is it possible? If not then also it is fin but it keeps on saving data back to the server (though the grid is disabled )
thanks

jarrednicholls
26 Jul 2010, 8:23 AM
Hi sajan,

Are you referring to any particular plugin? Each plugin is different, so whether or not the plugin can be disabled is on a case-by-case basis. Or maybe I'm not understanding correctly what you mean by the editor grid plugins. The "Save" and "Cancel" buttons show in the RowEditor plugin...is this the one you're referring to? If so, I can look into it and see if it can be disabled, and how.

Sorry for the back-and-forth, I appreciate your patience.

sajan
26 Jul 2010, 10:14 AM
Sorry Jarred,
Yes it is row editor plugin.
For an instance it should be enabled
for another it should be disabled

thanks