jQWidgets Forums
jQuery UI Widgets › Forums › Grid › Column displayfield
This topic contains 10 replies, has 2 voices, and was last updated by riccitelli 12 years, 6 months ago.
-
AuthorColumn displayfield Posts
-
Hi all,
I’ve a problem with displayfield property of column.
The value displayed isn’t the field I select in data source by displayfield property but the datafield one.
I don’t understand how to display a value and how to use another one for array returned by getrows method.
Thx in advance
Hi riccitelli,
The following sample shows how to create a Column with Display and Value fields: gridkeyvaluecolumn.htm.
In case the Key/Value column is editable, check this sample, too: gridkeyvaluescolumnwitharray.htm.
Best Regards,
Peter StoevjQWidgets Team
http://www.jqwidgets.comI have a datasource in Json format like this:
"[{"id":2,"parentId":1,"text":"[String] host","tag":"host|String|host"},{"id":3,"parentId":1,"text":"[String] category","tag":"category|String|category"},{"id":4,"parentId":1,"text":"[Integer] eventCode","tag":"eventCode|Integer|eventCode"},{"id":5,"parentId":1,"text":"[Integer] eventIdentifier","tag":"eventIdentifier|Integer|eventIdentifier"},{"id":6,"parentId":1,"text":"[String] message","tag":"message|String|message"},{"id":7,"parentId":1,"text":"[Integer] recordNumber","tag":"recordNumber|Integer|recordNumber"},{"id":8,"parentId":1,"text":"[String] rawMessage","tag":"rawMessage|String|rawMessage"},{"id":9,"parentId":1,"text":"[Date] timeGenerated","tag":"timeGenerated|Date|timeGenerated"},{"id":10,"parentId":1,"text":"[String] ownDesc","tag":"ownDesc|String|ownDesc"},{"id":11,"parentId":1,"text":"[String] domain","tag":"domain|String|domain"},{"id":12,"parentId":1,"text":"[String] user","tag":"user|String|user"},{"id":13,"parentId":1,"text":"[String] accessId","tag":"accessId|String|accessId"},{"id":14,"parentId":1,"text":"[String] accessType","tag":"accessType|String|accessType"},{"id":15,"parentId":1,"text":"[String] originalMachine","tag":"originalMachine|String|originalMachine"},{"id":16,"parentId":1,"text":"[String] originalIp","tag":"originalIp|String|originalIp"},{"id":17,"parentId":1,"text":"[String] originalPort","tag":"originalPort|String|originalPort"}]"
I bind the text field how displayfield but i view in the grid always the datafield (tag).
This is my jqxGrid definition:
$("#gridStepSixMapping").jqxGrid( { width: 400, theme: 'classic', source: dataAdapter, pageable: true, autoheight: true, altrows: true, enabletooltips: true, editable: true, columns: [ { text: 'Mapping', displayfield: 'text', datafield: 'tag', width: 200, editable: false }, { text: '@Resources.Global.Path', datafield: 'source', width: 200, editable: false }, ] });
Thx you
Hi riccitelli,
Please, ensure that you use the correct version of jQWidgets and especially jQWidgets 2.7. In case you use the latest version, then please provide your dataAdapter’s initialization code, too.
Best Regards,
Peter StoevjQWidgets Team
http://www.jqwidgets.comjqxWidgets version is old… 2.5.0. Updating to the latest version is in roadmap.
My dataAdapter initialization code:
var source = { localdata: sources, datatype: "json" }; var dataAdapter = new $.jqx.dataAdapter(source);
Sources is an array on which JSON.stringify method has been applied.
Hi riccitelli,
The API available on our website is valid only for the latest version which is jQWidgets 2.7. The API available for the version that you use is available in your download package for jQWidgets 2.5
Best Regards,
Peter StoevjQWidgets Team
http://www.jqwidgets.comIs it possible to have download package of 2.5 version ? Unfortunately I’ve lost it
Hi riccitelli,
Here’s a link: jqwidgets-ver2.5.zip.
Best Regards,
Peter StoevjQWidgets Team
http://www.jqwidgets.comThe example is not available in 2.5.0. Do you confirm that the functionality is present from 2.5.5 version?
Thx
Hi riccitelli,
I am not sure on which version that feature was added, but I am sure that it is in jQWidgets 2.7, because it is included in the online documentation.
Best Regards,
Peter StoevjQWidgets Team
http://www.jqwidgets.comOk, thanks.
Best regards
-
AuthorPosts
You must be logged in to reply to this topic.