带有多选下拉列表的jQuery Tabledit

问题描述 投票:0回答:1

我正在使用jQuery Tabledit,我们可以选择使用输入框和Drop-drop,但截至目前,我需要在一个下拉菜单中进行多项选择。

如果有人对此有任何解决方案,请帮助我们。帮助非常值得一提。

jquery
1个回答
0
投票

我不确定这是你的期望,

$(function() {

  var $table = $('table');
  $table
    .Tabledit({
      columns: {
        identifier: [0, 'id'],
        hideIdentifier: true,
        editable: [
          [1, 'App Date'],
          [2, 'App Time'],
          [3, 'Service Type', '{"1": "@mdo", "2": "@fat", "3": "@twitter", "4": "@university"}',]
        ]
      }
    })
    .on('click', 'button:not(.tabledit-save-button)', function() {
      // prevent sorting while editing
      $table[0].isUpdating = $(this).closest('td').hasClass('tabledit-edit-mode');
    })
    .find('select[name="Service Type"]').attr('multiple', 'multiple')
    .on('click', 'button.tabledit-save-button', function() {
        // update tablesorter cache
      $table.trigger('update');
    })
});

JSFIDDLE

© www.soinside.com 2019 - 2024. All rights reserved.