EasyUI Forum
May 14, 2024, 12:12:30 PM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News:
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: extend DeleteRowSelected  (Read 10315 times)
iscenigmax
Newbie
*
Posts: 1


View Profile Email
« on: May 30, 2013, 12:07:41 PM »

This is my code the problem I have is that once you take the selected rows and the index change causes me wrong, someone had a similar problem ah, thank you.

Code:
    $.extend
    (
        $.fn.datagrid.methods,
        {
            DeleteRowSelected: function (jq) {
                return jq.each
                (
                    function () {
                        //var row = $(this).datagrid('getSelected');
                        //if (row) {
                            //var idx = $(this).datagrid('getRowIndex', row);
                            //$(this).datagrid('deleteRow', idx);
                        //}
                        var Me = $(this);
                        $.each(Me.datagrid('getSelections'), function (i, item) {
                              var idx = Me.datagrid('getRowIndex', item);
                              Me.datagrid('deleteRow', idx);
                        });
                    }
                )
            }
        }
    );


Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!