jQuery UI Widgets › Forums › DataTable › Dynamic rowDetails height in jqxDataTable
Tagged: dynamic, initrowdetails, jQuery, jqxData, rowdetails
This topic contains 6 replies, has 5 voices, and was last updated by Hristo 4 years, 9 months ago.
-
Author
-
Hi,
I use jqxDataTable. Some data is displayed in the ‘rowDetails’. In some conditions, those details would be null, So that a single message is displayed in the row, For example: “Details processing Failed”. So I want to dynamically reduce the size of the rowDetails. How can do that dynamically in javascript$("#metaDataTable").jqxDataTable({ width : 908, height : 390, source : dataAdapter, theme : 'ui-redmond', rowDetails : true, sortable : true, pagerButtonsCount: 8, initRowDetails : initRowDetails, columns : [ {text : 'Name',dataField : 'Name',width : 550}, {text : 'Type',dataField : 'dataType',width : 520} ], });
Hi srivaishnavi,
You can set rowinfo.detailsHeight in your initRowDetails callback.
For example:if(detailsCondition){ rowinfo.detailsHeight = 300; }else{ rowinfo.detailsHeight = 50; }
Best Regards,
Ivailo IvanovjQWidgets Team
http://www.jqwidgets.comThat was Awesome ! Thanks
Good Morning,
I’m using the “jqwidgets-ng”: “^9.0.0”, is there a way to do this?
In my case, my inirowdetalscallback there isn’t rowinfo, where is it?These are my arguments in my callback
(index: number, parentElement: any, gridElement: any, datarecord: any)Hello thiagodebona,
Could you clarify it?
If you want to have a different height for the different rows the row details could use specific height, depending on the case.
Please, take a look at this example.Also, if you use the jqxGrid then I would like to suggest you look at this demo:
https://www.jqwidgets.com/jquery-widgets-demo/demos/jqxgrid/rowdetails-custom-height.htm?lightBest Regards,
Hristo HristovjQWidgets team
https://www.jqwidgets.comAre these magic properties documented anywhere? What other properties exist on rowinfo? Can I make it scroll if the content is too big? Does that require a template? The docs and examples seem very light for this extremely useful feature (rowDetails) which I am using quite a bit – I’d like to be able to reduce the amount of runtime DOM changes I have to make to take advantage of this feature (the row details I am generating are unique to literally every row, so even a template approach only gets me as far as a simple container, maybe some surrounding controls – content is all unique per row).
Hello whaduu,
You could look at the API Documentation page about the
rowdetailstemplate
property.
The new thing is that it could be used as a callback (or just an object) and as in the mentioned demos you could determinate the height depends on the case.Best Regards,
Hristo HristovjQWidgets team
https://www.jqwidgets.com -
AuthorPosts
You must be logged in to reply to this topic.