|
@@ -352,6 +352,13 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
|
|
|
var admin_id = row.id;
|
|
|
var cur_table = $detail.html('<table id="sub_'+ admin_id +'" style="background-color:#d7d1d147"></table>').find('table');
|
|
|
var sub_table = $(cur_table);
|
|
|
+ var parent_options = parent_table.bootstrapTable("getOptions");
|
|
|
+ var parent_selectids = parent_options.selectedIds;
|
|
|
+ var checked = false;
|
|
|
+ if (parent_selectids.indexOf(admin_id) !== -1) {
|
|
|
+ checked = true;
|
|
|
+ }
|
|
|
+ parent_options.subSelectedIds[admin_id] = [];
|
|
|
sub_table.bootstrapTable({
|
|
|
// url: 'area/index',
|
|
|
toolbar: false,
|
|
@@ -366,8 +373,6 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
|
|
|
columns: [
|
|
|
{checkbox: true,
|
|
|
formatter: function(value,rows,index){
|
|
|
- console.log('Config.user_ids');
|
|
|
- console.log(Config.user_ids);
|
|
|
if(Config.user_ids.length==0){
|
|
|
return false;
|
|
|
}else if(Config.user_ids.indexOf(rows.id)>-1){
|
|
@@ -384,13 +389,34 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
|
|
|
data: row.alluser
|
|
|
});
|
|
|
Table.api.bindevent(sub_table);
|
|
|
+ if(checked){
|
|
|
+ sub_table.bootstrapTable("checkAll");
|
|
|
+ }else{
|
|
|
+ sub_table.bootstrapTable("uncheckAll");
|
|
|
+ }
|
|
|
sub_table.on("check.bs.table uncheck.bs.table check-all.bs.table uncheck-all.bs.table post-body.bs.table", function (e) {
|
|
|
var selectedIds = Table.api.selectedids(sub_table);
|
|
|
+ // selectedData = Table.api.selecteddata(sub_table);
|
|
|
+ // parent_options.subSelectedIds= [];
|
|
|
+ // parent_options.subSelectedIds[admin_id] = selectedIds;
|
|
|
+ // parent_options.subSelectedData[admin_id] = selectedData;
|
|
|
+ //
|
|
|
+ // var allSubselectIds = [];
|
|
|
+ // var allSubselectData = [];
|
|
|
+ // var allSubselectProjectlib = [];
|
|
|
+ // for (var i in parent_options.subSelectedIds) {
|
|
|
+ // allSubselectIds.push.apply(allSubselectIds, parent_options.subSelectedIds[i]);
|
|
|
+ // }
|
|
|
+ // for (var j in parent_options.subSelectedData) {
|
|
|
+ // allSubselectData.push.apply(allSubselectData, parent_options.subSelectedData[j]);
|
|
|
+ // }
|
|
|
+ // parent_options.allSubselectIds = allSubselectIds;
|
|
|
+ // parent_options.allSubselectData = allSubselectData;
|
|
|
console.log(selectedIds);
|
|
|
$(".xueyuan_input").val(selectedIds.length);
|
|
|
$(".xueyuan_total").html(selectedIds.length);
|
|
|
$(".depart_ids").val(selectedIds.join());
|
|
|
- })
|
|
|
+ });
|
|
|
},
|
|
|
bindevent2: function () {
|
|
|
var rel_Ids = [];
|
|
@@ -415,6 +441,10 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
|
|
|
fixedColumns: true,
|
|
|
fixedRightNumber: 1,
|
|
|
searchFormVisible:false,
|
|
|
+ subSelectedIds: {},
|
|
|
+ subSelectedData: {},
|
|
|
+ allSubselectIds: [],
|
|
|
+ allSubselectData: [],
|
|
|
// pagination:false,
|
|
|
detailView: true,//父子表
|
|
|
Search:false,
|
|
@@ -426,13 +456,13 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
|
|
|
]
|
|
|
],
|
|
|
onExpandRow: function (index, row, $detail) {
|
|
|
- Controller.api.initSubTable(index, row, $detail);
|
|
|
+ Controller.api.initSubTable(index, row, $detail,table);
|
|
|
},
|
|
|
onCheck: function (row, $element) {
|
|
|
$('.btn-disabled').addClass('disabled');
|
|
|
var id = row.id;
|
|
|
+ console.log('选中了')
|
|
|
$("#sub_" + id).bootstrapTable("checkAll");
|
|
|
-
|
|
|
},
|
|
|
onUncheck: function (row) {
|
|
|
var id = row.id;
|