I am using jqgrid in ‘multiselect’ mode and without pagination. When the user selects individual records by using mouse click, is there any way that I can bring those selected records to the top of the grid?
Thanks in advance for your help.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
After small discussion with you in comments I could reformulate your question so: “how one can implement sorting by multiselect column?”
The question find is very interesting so I invested some time and could suggest a solution in case of jqGrid which hold local data (
datatypewhich is not ‘xml’ or ‘json’ or which has ‘loadonce: true’ option).First of all the working demo which demonstrate my suggestion you can find here:
The implementation consist from two parts:
To implement of holding selection I suggest to extend local
dataparameter, which hold local data with the new boolean propertycb(exactly the same name like the name of the multiselect column). Below you find the implementation:To make ‘cb’ column (multiselect column) sortable I suggest to do following:
UPDATED: The demo contain a little improved code based on the same idea.