jQuery UI Widgets › Forums › Grid › list filter value and display text?!
Tagged: filter, filter items, filteritems, grid, jqxgrid
This topic contains 3 replies, has 2 voices, and was last updated by Dimitar 11 years, 1 month ago.
-
Author
-
Hi,
a question for your grid component.
I need a dropdown filter box which display a text which is NOT the real value behind it.At the moment I have this column definition:
{ text: ‘Document Type’, datafield: ‘documentType’, filtertype: ‘list’, filteritems: [‘Black Tea’, ‘Green Tea’, ‘Caffe Latte’], align: ‘center’, width: 125 }But I would wish something like this:
{ text: ‘Document Type’, datafield: ‘documentType’, filtertype: ‘list’, filteritems: [‘bt:Black Tea’, ‘gt:Green Tea’, ‘cl:Caffe Latte’], align: ‘center’, width: 125 }where the two letter value is the real value inside the db for example (So this value will be send to the server) but the user sees only the description.
Is it already possible, or would this be a new feature?
Kind regards
Hello NoiZy,
Unfortunately, this functionality is not supported by jqxGrid.
Best Regards,
DimitarjQWidgets team
http://www.jqwidgets.com/Can you implement this feature in the near future?
If not, I think that would be a “No go” for my company and for the enterprise license we want to buy.
This would be essential because, we are working with some type of official interface what uses extreme long names because they only thought of technical purpose, but there are common used short terms for this tongue-twisters and in complex grids with much columns is no space for this long names.Kind regards
Hi NoiZy,
You can format the parameters sent to the server with the source formatdata callback function. Here is an excerpt from the API Documentation about it:
formatdata – Before the data is sent to the server, you can fully override it by using the ‘formatdata’ function of the source object. The result that the ‘formatdata’ function returns is actually what will be sent to the server.
var source ={ datatype: "jsonp", datafields: [ { name: 'countryName' }, { name: 'name' }, { name: 'population', type: 'float' }, { name: 'continentCode' } ], url: "http://ws.geonames.org/searchJSON", data: { featureClass: "P", style: "full", maxRows: 50 }, formatdata: function (data) { return "my data"; }};
Best Regards,
DimitarjQWidgets team
http://www.jqwidgets.com/ -
AuthorPosts
You must be logged in to reply to this topic.