0
1
Fork 0
hedera-web-mindshore/js/vn/json-model.js

91 lines
1.3 KiB
JavaScript
Raw Normal View History

2017-04-19 06:16:37 +00:00
var VnObject = require ('./object');
var ModelIface = require ('./model-iface');
var ModelProxy = require ('./model-proxy');
var Mode = ModelProxy.Mode;
/**
* Model that holds an array of Javascript objects with
* the same structure.
*/
module.exports = new Class
({
Extends: VnObject
,Implements: ModelIface
,Tag: 'vn-json-model'
,Properties:
{
numRows:
{
type: Number
},
status:
{
type: Number
},
mode:
{
enumType: Mode
,value: Mode.ON_CHANGE
},
data:
{
type: Array
,set: function (x)
{
this.data = x;
}
,get: function ()
{
return this.data;
}
}
}
,checkColExists: function () {}
,checkRowExists: function () {}
,getColumnIndex: function () {}
,get: function (rowIndex, columnName)
{
return this.data[rowIndex][columnName];
}
,getByIndex: function (rowIndex, column)
{
var columnName = this.columns[column];
return this.data[rowIndex][columnName];
}
,getObject: function (rowIndex)
{
return this.data[rowIndex];
}
,sortByName: function () {}
,sort: function () {}
,search: function () {}
,searchByIndex: function () {}
,set: function () {}
,setByIndex: function () {}
,deleteRow: function () {}
,insertRow: function () {}
,clean: function () {}
,performOperations: function () {}
,indexColumn: function () {}
});