EasyUI Forum
March 29, 2024, 05:57:12 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: I want to make a toolbar with switchbutton.  (Read 5410 times)
vennylv
Newbie
*
Posts: 3


View Profile Email
« on: February 25, 2018, 11:39:20 PM »


I created a datagrid with subgrid.

Configured to create individual toolbar from each subgrid.

I would like to configure toolbar with switchbutton in a javascript style.

Is it possible? Please tell me the solution.

Logged
stworthy
Administrator
Hero Member
*****
Posts: 3581


View Profile Email
« Reply #1 on: February 26, 2018, 12:52:55 AM »

Please refer to this code:
Code:
view: detailview,
detailFormatter: function(rowIndex, rowData){
  return '<div class="ddv"></div>';
},
onExpandRow: function(index,row){
  var ddv = $(this).datagrid('getRowDetail',index).find('.ddv');
  var dg = ddv.find('.datagrid');
  if (!dg.length){
    var tb = $('<div></div>');
    dg = $('<table></table>').appendTo(ddv);
    dg.datagrid({
      height: 200,
      columns: [[
        {field:'started',title:'Started',width:100},
        {field:'ended',title:'Ended',width:100}
      ]],
      toolbar: tb
    });
    $('<a href="javascript:;"></a>').appendTo(tb).linkbutton({
      plain: true,
      iconCls: 'icon-add',
      text: 'Add'
    });
    $('<a href="javascript:;"></a>').appendTo(tb).linkbutton({
      plain: true,
      iconCls: 'icon-remove',
      text: 'Del'
    });
    $('<input>').appendTo(tb).switchbutton();
    $(this).datagrid('fixDetailRowHeight', index);
  }
}
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!