How at a time one row can expand in

?

前端 未结 4 1825
抹茶落季
抹茶落季 2020-12-10 17:45

In my application I have a with rowExpansion column. I have a requirement to open a single row at a time. If anyone tries to ex

4条回答
  •  庸人自扰
    2020-12-10 18:12

    you can achieve this with the help of this custom method.

    give 'togglerClass' this class like

     
                                                
                                            
    

    JavaScript code here;

    function prodsToggler() {
        $('.togglerClass div').click(function () {
            var currentTr = $(this).closest("tr");
            var $trs = $('.togglerClass').closest("tr").not(currentTr);
            $trs.each(function (index, el) {
                var $this = $(el),
                        $next = $this.next(".ui-expanded-row-content");
    
                $this.removeClass("ui-expanded-row");
                $next.remove();
    
                $this.find(".ui-row-toggler").removeClass("ui-icon-circle-triangle-s");
            });
        });
    }
    

    call this method in windows ready.

提交回复
热议问题