Quantcast

FilteringSelect in gridx

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

FilteringSelect in gridx

adros
I would like to use FilteringSelect as editor in my grid (with alwaysEditing feature turned off). I have found the sample (/gridx/tests/test_grid_edit.js), but in the sample, the filtering select is bound to grid which has 'idAttribute' same as 'searchAttribute'.

What is the strategy for more realistic situations, where id of an item is e.g. number? Because in such a situation 'id' is displayed in the cell after editor is hidden.

In EnhancedGrid, we have solved this using special formatter which fetched the item from the store according to id and then returned label of the item. This was possible because EnhancedGrid supports Deferred as output from formatter, but I didn't find this possibility in gridx.

Any suggestions?
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: FilteringSelect in gridx

zhuxw
Hi, you can use fromEditor/toEditor functions if the displayed data is different from the data in your FilteringSelect.

e.g.:
{ field: "Album", name:"FilteringSelect", width: '100px', editable: true,
editor: FilteringSelect,
editorArgs: {
props: 'store: fsStore, searchAttr: "id"',
fromEditor: function(value, cell){
return ...//the value is from the FilteringSelect (after editing), do anything you want here, and what you return will be displayed in cell.
},
toEditor: function(data){
return ...//data is the grid data, do anything you want here, and what you return will be set to the FilteringSelect by set('value', ...) method.
}
}
},


On Wed, Feb 6, 2013 at 9:36 PM, adros <[hidden email]> wrote:
I would like to use FilteringSelect as editor in my grid (with alwaysEditing
feature turned off). I have found the sample
(/gridx/tests/test_grid_edit.js), but in the sample, the filtering select is
bound to grid which has 'idAttribute' same as 'searchAttribute'.

What is the strategy for more realistic situations, where id of an item is
e.g. number? Because in such a situation 'id' is displayed in the cell after
editor is hidden.

In EnhancedGrid, we have solved this using special formatter which fetched
the item from the store according to id and then returned label of the item.
This was possible because EnhancedGrid supports Deferred as output from
formatter, but I didn't find this possibility in gridx.

Any suggestions?



--
View this message in context: http://dojo-toolkit.33424.n3.nabble.com/FilteringSelect-in-gridx-tp3993864.html
Sent from the Dojo Toolkit mailing list archive at Nabble.com.
________________________________________________________
Dojo Toolkit: http://dojotoolkit.org/
Tutorials: http://dojotoolkit.org/documentation/
Reference Guide: http://dojotoolkit.org/reference-guide
API Documentation: http://dojotoolkit.org/api

[hidden email]
To unsubscribe, visit: http://mail.dojotoolkit.org/mailman/listinfo/dojo-interest



--
Best Regards.
-------------------------------
Oliver (Zhu Xiao Wen)

________________________________________________________
Dojo Toolkit: http://dojotoolkit.org/
Tutorials: http://dojotoolkit.org/documentation/
Reference Guide: http://dojotoolkit.org/reference-guide
API Documentation: http://dojotoolkit.org/api

[hidden email]
To unsubscribe, visit: http://mail.dojotoolkit.org/mailman/listinfo/dojo-interest
Best Regards
-------------
Oliver
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: FilteringSelect in gridx

pauravi.wagh12
This post has NOT been accepted by the mailing list yet.
In reply to this post by adros
I tried using filtering select in gridx grid. What I observed is, if a cell has a filtering select widget and if we double click it to change its value , the value becomes blank. Which is not its default behavior. The value should remain there as it is ...
Can you explain how do I do it?
Thank you
Loading...