Roberto Nicchi Posted May 12, 2021 Share Posted May 12, 2021 What i need is to select the rows of a grid depending on some condition. The condition in this particular case is the value of a field; if the field has some value the record must be selected, otherwise not selected. This task must be executed after the grid has been loaded so i guess the right place where to place the code is in the OnAfterLoad event of the grid. Now i have the code to select or deselect all the rows but i have no idea how to select/unselect rows with a condition. Possible ? thanks Quote Link to comment Share on other sites More sharing options...
alex_v Posted March 31, 2023 Share Posted March 31, 2023 On 5/12/2021 at 1:46 PM, Roberto Nicchi said: What i need is to select the rows of a grid depending on some condition. The condition in this particular case is the value of a field; if the field has some value the record must be selected, otherwise not selected. This task must be executed after the grid has been loaded so i guess the right place where to place the code is in the OnAfterLoad event of the grid. Now i have the code to select or deselect all the rows but i have no idea how to select/unselect rows with a condition. This question is also important for me Quote Link to comment Share on other sites More sharing options...
Sherzod Posted March 31, 2023 Share Posted March 31, 2023 5 hours ago, alex_v said: This question is also important for me Hello, Please explain your case in more detail. And what problem do you face in order to achieve the desired result? Quote Link to comment Share on other sites More sharing options...
alex_v Posted April 3, 2023 Share Posted April 3, 2023 I have already found a solution - in the Russian segment. Here is the link to the topic: http://forums.unigui.com/index.php?/topic/12627-unidbgrid-selectedrows/ I use such designs to achieve what I want 1) Select all rows in the grid: UniDbGrid.JSInterface.JSCall('getSelectionModel().selectAll', []); 2) Select only the lines that meet some condition: UniDbGrid.JSInterface.JSCall('getSelectionModel().select', [Row, true]); 3) Unselect all rows: UniDbGrid.JSInterface.JSCall('getSelectionModel().deselectAll', []); So far everything is running fine Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.