# DataWindow
# DataWindow
H5DW implementation, it is similar to powerbuilder's DataWindow. It extends DataStore, can use the function of DataStore
Kind: global class
# new DataWindow(el)
H5DW implementation, it is similar to powerbuilder's DataWindow. It extends DataStore, can use the function of DataStore
Param | Type | Description |
---|---|---|
el | String/Object | html element |
Example
let dataobject = {
processing:1,
table:{
retrieve:'test1',
update:'test1',
columns:[
{name:'id',dbname:'id',type:'long',key:true,update:true},
{name:'name',dbname:'name',type:"string",update:true},
{name:'price',dbname:'price',type:'number',update:true},
{name:'dt',dbname:'dt',type:'datetime',update:true}
],
}
}
let dw1 = new DataWindow('#datawindow');
dw1.dataObject = dataobject;
let rowcount = dw1.rowCount();
for (let i = rowcount; i < 10000 + rowcount; i++) {
const price = (Math.random() * 100).toFixed(2);
let ll_row = dw1.insertRow(0);
dw1.setItem(ll_row,'id',i );
dw1.setItem(ll_row,'name','name' + i);
dw1.setItem(ll_row,'price',price);
dw1.setItem(ll_row,'dt','2021-04-28');
}
# dataWindow.dataObject
set DataWindow's dataobject.
Kind: instance property of DataWindow
Param | Type | Description |
---|---|---|
value | JSON | dataobject |
Example
let dw1 = new DataWindow('#datawindow');
dw1.dataObject = dataobject;
# dataWindow.groupCalc()
Recalculates the breaks in the grouping levels in a DataWindow.
Kind: instance method of DataWindow
# dataWindow.setRedraw(redraw)
sets DataWindow if can be refresh,.
Kind: instance method of DataWindow
Param | Type | Description |
---|---|---|
redraw | Boolean | true or false. |
Example
dw1.setRedraw(true)
# dataWindow.design(value)
切换到设计模式.
Kind: instance method of DataWindow
Param | Type | Description |
---|---|---|
value | Boolean | true or false. |
Example
dw1.design(true)