bool.dev
(Lightcycleuser)
May 12, 2012, 9:47am
1
Well i saw in the source of yiigridview.js that
$.fn.yiiGridView.settings['grid-id']
is getting deprecated, so what will be the new way of accessing a gridview’s settings after it has been set up in the view?
Can anyone help me with this? I couldn’t figure it out by looking at the source, not very good in javascript
mdomba
(Maurizio Domba Cerin)
May 12, 2012, 10:17am
2
Actually there is no "new" way for this, can you explain what is the need to have access to whole settings?
bool.dev
(Lightcycleuser)
May 12, 2012, 11:10am
3
@mdomba , for example there was this question recently in stackoverflow, asking how to remove event handlers, and assign own event handler for a gridview.
For which we can use jquery’s off method.
Example:
$(document).off('click.yiiGridView',$.fn.yiiGridView.settings['example-grid'].updateSelector);
I understand that i can hard code the updateSelectors , but won’t code be easier to maintain if we could dynamically pass the value?
mdomba
(Maurizio Domba Cerin)
May 12, 2012, 11:44am
4
If the problem is in the selector, maybe adding an option for a custom selector instead of "document" would be enough ?
bool.dev
(Lightcycleuser)
May 12, 2012, 12:13pm
5
I’m not sure that i understand you clearly, where should this custom selector option be included?
mdomba
(Maurizio Domba Cerin)
May 12, 2012, 12:28pm
6
This is not implemented currently… It would be included in the JS file like other options (updateselector for example)…