BootstrapTable重新初始化

已经初始化的bootstrap table必须先销毁才可以再次初始化
function initQuoteReportTable(row){
	$('#quoteReport_table').bootstrapTable('destroy');    //先销毁才可再次初始化
	var projectName = row.PROJECT_NAME;
	var compositeName = row.COMPOSITE_NAME;
	var derDesignName = row.DER_DESIGN_NAME;
	var derHarnessPN = row.DER_HARNESSPN;
	var derDesignVersion = row.DER_DESIGN_VERSION;
	var instanceName = $("#instanceName").val();
	var $table = $("#quoteReport_table");
	$table.bootstrapTable({
		url : boot+"/vave/cavityAndCostList",
		toolbar: '#toolbar',
		striped: true,
		cache: false,
//		search: true,
		height: 400,
		pagination: true,
		pageSize: 50,
		pageList: [10, 25, 50, 100, 200],
		clickToSelect: true,
		sidePagination: 'server',
		queryParams:function(params){
			var pageNo = parseInt(params.offset/params.limit) + 1;
			return {
//				searchAll: params.search,
				pageSize: params.limit,
				pageNo: pageNo,
				projectName: projectName,
				compositeName: compositeName,
				derDesignName: derDesignName,
				derHarnessPN: derHarnessPN,
				derDesignVersion: derDesignVersion,
				instanceName: instanceName
			};
		},
		columns: [{
			field: 'RELATED_CAVITY',
			title: 'RelatedCavity',
//			visible: false,
			/*formatter: function (value, row, index) {
				return value.length>15?value.substring(0,15)+"...":value;
			},*/
			editable:{
				type:"text",
				title:"cavity",
			}
		},{
			field: 'THIS_COST',
			title: 'Cost',
//			visible: false,
			/*formatter: function (value, row, index) {
				return value.length>15?value.substring(0,15)+"...":value;
			},*/
			editable:{
				type:"text",
				title:"cavity",
			}
		}/*,{
			field: 'OPERATE',
			title: 'Operate',
			width : 100,
			formatter: function (value, row, index) {
				return [
					'',
					'Select',
					''
				].join('');
			},
			events: {
				'click .selectReportItem': function (e, value, row, index) {
					$('#quoteReport_model').modal('hide');
					addReportItemByQuote(row);
				}
			}
		}*/]
	});
};

 

你可能感兴趣的:(BootstrapTable重新初始化)