EasyUI Forum
September 14, 2025, 08:18:02 AM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News:
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: DataGrid Detailview + ajax  (Read 9689 times)
mazvv
Newbie
*
Posts: 20


View Profile WWW
« on: June 24, 2014, 11:57:17 AM »

Hi.
I try to use ajax for detailview. Part of my code is
Code:
            
            onExpandRow: function(index, row){
                var row_id = 'row-' + row.id;
                $('#' + row_id).load('/banks_details/details?id=' + row.id);
            },
            detailFormatter: function(index, row){
                var row_id = 'row-' + row.id;
                return '<div id=' + row_id + '></div>';
            },         
it works, but is this right way?
Logged

TravelCRM - opensource CRM for travel companies
jarry
Administrator
Hero Member
*****
Posts: 2298


View Profile Email
« Reply #1 on: June 25, 2014, 05:38:20 PM »

The 'detailFormatter' function only provide the detail content container. You can append any contents to this container.
Logged
mazvv
Newbie
*
Posts: 20


View Profile WWW
« Reply #2 on: June 26, 2014, 02:23:36 AM »

The main problem is height fixing of detailview row container.
Seems I had found good solution to do detailview with ajax, may be this code will be helpful
Code:
            view: detailview,
            onExpandRow: function(index, row){
                var row_id = 'row-${_id}-' + row.id;
                $('#' + row_id).load(
                    '/bpersons/details?id=' + row.id,
                    function(){
                        $('#${_id}').datagrid('fixDetailRowHeight', index);
                        $('#${_id}').datagrid('fixRowHeight', index);
                    }
                );
            },
            detailFormatter: function(index, row){
                var row_id = 'row-${_id}-' + row.id;
                return '<div id=' + row_id + '></div>';
            },         
Logged

TravelCRM - opensource CRM for travel companies
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!