Posted 28 January 2021, 3:07 am EST
Hello Team,
We have a requirement to implement multi row select using ctrl or shift keys using angularjs. How is that can be achieved? we need to export that selected range to a model.
Forums Home / Wijmo / General Discussion
Posted by: theruler0000 on 28 January 2021, 3:07 am EST
Posted 28 January 2021, 3:07 am EST
Hello Team,
We have a requirement to implement multi row select using ctrl or shift keys using angularjs. How is that can be achieved? we need to export that selected range to a model.
Posted 28 January 2021, 11:54 pm EST
Hi Ananth,
You can set the selectionMode of FlexGrid to ListBox and use the selectedItems property to get all the selected items of the grid.
Please refer to the demo link below:
https://www.grapecity.com/wijmo/demos/Grid/Selection/Overview/purejs
Set the selectionMode to ListBox and try selecting rows using Ctrl and Shift key.
Regards,
Ashwin
Posted 29 January 2021, 2:59 am EST
we are using 2017 version of wijmo
Posted 31 January 2021, 11:41 pm EST
Sorry, but I was not able to replicate the issue. I tried with the 5.20172.334 version and the ListBox selection mode is working as expected. Can you provide a screenshot or a video that shows what behavior is displayed by flexgrid?
I have attached a sample for reference. You can also modify the sample so that it replicates your issue.
~regards
Posted 1 February 2021, 1:42 am EST
Ohh, I think angularjs is being loaded properly in the sample. In the index.html file, update the CDN link of angularjs to this:
<script
type="text/javascript"
src="https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.2.1/angular.js"
></script>
~regards
Posted 1 February 2021, 1:49 am EST
Still facing the same issue Ashwin with more errors in the console.
Posted 1 February 2021, 1:58 am EST
Can you provide a screenshot of the errors? It may be possible that a CORS error is displayed in the browser. If this error is displayed, then you will need to use a server for running this sample. You can use the lite-server for this. This is a small utility that hosts your application on a server:
Posted 1 February 2021, 2:21 am EST
It seems that Wijmo is not being loaded properly in the sample. I have created an online sample for this:
Posted 1 February 2021, 5:33 am EST
Hi Ashwin, I found the issue. Issue is with cdn’s. I have modified them and working. will try to fix in the code. Thank you
Posted 2 February 2021, 12:49 am EST
please unzip the file for video
Posted 2 February 2021, 12:52 am EST
The mails at the middle block which i am trying to select should be multi selected. But could not able to make it
Posted 3 February 2021, 1:24 am EST
Sorry for the delay in response. While investigating your code, I have 2 queries:
From the video, it is not clear whether you are pressing the Ctrl key or not. So, please make sure you are pressing Ctrl key and then clicking on different rows for multiple selection.
The initialized method of FlexGrid is handled using makeDraggable. Can you let me know how you are making the cells draggable? It may be possible that this code may be preventing multiple selections.
~regards
Posted 4 February 2021, 2:30 am EST
Hello Ashwin, Sorry for the delay in reply.
In the video I am pressing the ctrl and trying to select multiple rows
Do you need the code for draggable method?
Posted 4 February 2021, 3:52 am EST
You are right Ashwin. As per your suggestion I have disabled the code for draggable. Now am able to select multiple rows using ctrl and shift keys.
Thanks for your endless support and suggestion.
Posted 8 February 2021, 1:27 am EST
Hi Ashwin, Is it Possible to have click using ctrl and shift keys along with the above mentioned draggable method?
Posted 9 February 2021, 8:37 am EST
Hi Ananth,
Please refer to the sample attached. This demonstrates how you can make grid draggable along with multiple row selection.
~regards