BootDo框架中使用bootstrap设置多个按钮的下拉按钮

直接进入对应的列表页面的js:

{
      title: '操作',
       field: 'id',
       align: 'left',
       formatter: function (value, row, index) {
           var a = '<a  href="#"   mce_href="#" ' +
                   'onclick="read(\'' + row.customId + '\',\'' + row.customType + '\')"><i class="btn btn-info btn-xs '+s_read_h+'">操作1</i></a> ';
           var b = '<a  href="#" mce_href="#" onclick="distribution(\''
               + row.customId
               + '\')"><i class="btn btn-info btn-xs '+s_distribution_h+'">操作2</i></a> ';
           var c = '';
           var g = '';
           var h = '';

           var d=  '';
           var e= '';

           var f = ' ';
           var menu = '<div class="btn-group "  >'+
                   '<button type="button" class="btn btn-info btn-xs"  aria-haspopup="true" aria-expanded="false">' +
                   '查看' +
                    '</button>' +
                   '<button data-toggle="dropdown"  class="btn btn-info btn-xs dropdown-toggle" >' +
                        '<span class="caret" ></span> ' +
                       '<span class="sr-only">Toggle Dropdown</span>'+
                   '</button> ' +
                   '<ul class="dropdown-menu" role="menu" >' +
                       '<li>'+a+'</li> ' +
                       '<li>'+b+'</li> ' +
                       '<li>'+c+'</li> ' +
                       '<li>'+d+'</li> ' +
                       '<li>'+e+'</li> ' +
                       '<li>'+f+'</li> ' +
                       '<li>'+g+'</li> ' +
                       '<li>'+h+'</li> ' +
                   ' </ul>'+
               '</div>';

           return menu;
       }
   }]

猜你喜欢

转载自blog.csdn.net/shunzi1046/article/details/80766136