hi friends,
problem: page have a grid inside 3 detail grids are there. Need to hide 2nd detail grid based on condition
kindly suggest me how to loop the grid detail rows
var $gridrows = $("#grd").data("kendoGrid").dataSource.data();
hi friends,
problem: page have a grid inside 3 detail grids are there. Need to hide 2nd detail grid based on condition
kindly suggest me how to loop the grid detail rows
var $gridrows = $("#grd").data("kendoGrid").dataSource.data();
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Brahma Prakash ShuklaPosted Jun 23, 2023, 5:45 AM
Hi @Murali, To loop through the rows of a grid and apply a condition to hide the second detail grid, you can use JavaScript or jQuery. Here's an example using jQuery based on the code snippet you provided:
In the code above,
$gridrowsrepresents the rows of the grid obtained from the grid's data source. TheforEachloop iterates over each row in the grid. You can modify the condition within the loop to meet your specific requirement for hiding the second detail grid. If the condition is met, thehide()method is called on the element representing the second detail grid (identified using a specific class,.detail-grid-classin this example).Make sure to replace
.detail-grid-classwith the appropriate class or selector that identifies the second detail grid element in your HTML structure.Vishal JoshiPosted Jun 21, 2023, 5:12 AM
Hello Murali,
Please take a look at the below-given link shows a detailed example of a nested grid using kendo UI.
https://docs.telerik.com/kendo-ui/knowledge-base/grid-add-nested-child-grids
You can use the detailInit method of the Kendo UI grid to add conditions.
Ref. Link: https://docs.telerik.com/kendo-ui/api/javascript/ui/grid/events/detailinit
Thanks
Mohamed Azarudeen ZPosted Jun 20, 2023, 9:09 PM
To loop through the rows of a grid using the Kendo UI Grid, you can use the
data()method to retrieve the grid's data source and then iterate over the rows. Here's an example: