
function genData() {
	var data = [];
	for(var i = 0; i < 500; i++) {
		data.push({
			name:"QToolKit"+i, 
			age:i, 
			gender:i%2?"Male":"Female",
			address:"https://qtoolkit.github.io/demos/index.html"
		});
	}

	return data;
}

function createViewModal() {
	var viewModal = qtk.CollectionViewModal.create(genData());

	return viewModal;
}

function onReady(app) {
	var vp = app.getViewPort();
	var win = qtk.WindowNormal.create({app:app, w:vp.width, h:vp.height});
	
	win.childrenLayouter = qtk.SimpleLayouter.create();

	var table = qtk.Table.create({indexBarW:80});
	table.layoutParam = qtk.SimpleLayouterParam.create({w:"100%", h:"100%"});
	
	win.addChild(table);

	table.addColumn(qtk.TableColInfo.create("Name", "label", 100, {dataBindingRule:"name"}));
	table.addColumn(qtk.TableColInfo.create("Age", "edit", 100, {inputType:"number", dataBindingRule:"age"}));
	table.addColumn(qtk.TableColInfo.create("Gender", "combo-box", 100, {dataBindingRule:"gender",
		options:[{text:"Male"}, {text:"Female"}]
	}));
	table.addColumn(qtk.TableColInfo.create("Address", "edit", table.w-320, {dataBindingRule:"address"}));
	
	var viewModal = createViewModal();
	table.bindData(viewModal);

	win.target = table;
	win.open();
}

@@ -519,16 +519,37 @@
 ate();%0A%0A
+%09var indexBarW = 80;%0A
 %09var tab
@@ -581,18 +581,25 @@
 dexBarW:
-80
+indexBarW
 %7D);%0A%09tab
@@ -1034,24 +1034,60 @@
 le%22%7D%5D%0A%09%7D));%0A
+%09var w = table.w - 310 - indexBarW;%0A
 %09table.addCo
@@ -1138,19 +1138,9 @@
 t%22, 
-table.w-320
+w
 , %7Bd

update demos