EasyUI Forum

General Category => EasyUI for jQuery => Topic started by: svsnead on February 28, 2016, 01:03:46 PM



Title: unselect a row in a datagrid[SOLVED]
Post by: svsnead on February 28, 2016, 01:03:46 PM
How do you unselect a row or is there not a way? Left click select but what unselects it? I tried a lot of things but nothing works. If someone could help that would be greatly appreciated.


Title: Re: unselect a row in a datagrid
Post by: svsnead on February 28, 2016, 05:46:33 PM
I have tried the following and it does work not sure what I doing wrong.

Code:
                     $('#c1').datagrid('unselectRow');



Title: Re: unselect a row in a datagrid
Post by: svsnead on February 28, 2016, 06:39:41 PM
I guess for some reason you need to use the unselectAll that seem to work:


Code:
		function doChapters(){

                     if ($('#c4').is(":visible")){
                       $('#c4').hide();
                     }
                      else{
                       chaptersw=0; //select chapter mode
                       memberid = document.getElementById("m_id").value;
                       $("#mem_id").val(memberid);
                       fname = document.getElementById("fname").value;
                       $("#f_name").val(fname);
                       lname = document.getElementById("lname").value;
                       $("#l_name").val(lname);
                       $('#c4').show();
                       $("#c4").css('zIndex', 9999);
                       $('#ci').datagrid('load');
                       $('#ci').datagrid('unselectAll'); //clear selected
                      }
    }




Title: Re: unselect a row in a datagrid[SOLVED]
Post by: battlezad on March 01, 2016, 04:31:27 AM
unselectRow needs parameter.

 $('#c1').datagrid('unselectRow', index);