Score
0
Watch 2.8K Star 9.7K Fork 4.7K

GVP若依 / RuoYiJavaMIT

$.table.init多个options

Closed
王军亮  Opened this issue

$.table.init多个options确认每个tableID不一样,toolbarID也不一样,formID也不一样,最后那个createUrl、updateUrl、removeUrl把前面那个覆盖掉,这个怎么解决?或者说怎么初始化多个table,现在的是其他都没有问题,就是点击toolbar里面的添加的时候不对
table1:
var options = {
id: "bootstrap-table1",
toolbar: "toolbar1",
url: prefix + "/list",
createUrl: prefix + "/add",
updateUrl: prefix + "/edit/{id}",
removeUrl: prefix + "/remove",
exportUrl: prefix + "/export",
$.table.init(options);
table2:
var options1 = {
id: "bootstrap-table2",
toolbar: "toolbar2",
url: assetsPrefix+ "/list",
createUrl: assetsPrefix+ "/add",
updateUrl: assetsPrefix+ "/edit/{id}",
removeUrl: assetsPrefix+ "/remove",
exportUrl: assetsPrefix+ "/export",
$.table.init(options1);

110134_xjswmgw 1151004_y_project total 3 participants

Comments (2)

110134_xjswmgw
小泥人 2019-12-03 19:19

通过toolbar id 和 使用不同的options名字,就行啊,我刚刚在不同tab实现了这个功能。
var car_prefix = ctx + "baseinfo/car";
var driver_prefix = ctx + "baseinfo/driver";

               $(function() {
                var options_car = {
                    id:"car_bootstrap-table",
                    toolbar:"car_toolbar",
                    
                };
                var options_driver = {
                    toolbar:"driver_toolbar",
                    id:"driver_bootstrap-table",
                    url: driver_prefix + "/listByCarrier",
                   
                };
                $.table.init(options_car);
                $.table.init(options_driver);
                });
1151004_y_project
若依 2019-12-06 14:47 owner

楼上正解,如果会被覆盖 建议你更新最新版本ry-ui.js

Sign in to comment

Assignees
Labels
Not set
Projects
Milestones
Branches
Planed to start
Not set
Planed to end
Not set
Top level
Priority
Java
1
https://gitee.com/y_project/RuoYi.git
git@gitee.com:y_project/RuoYi.git
y_project
RuoYi
RuoYi

Help Search