0
1
Fork 0
hedera-web-mindshore/js/db/iterator.js

85 lines
1.2 KiB
JavaScript
Raw Normal View History

2015-07-03 05:49:45 +00:00
2017-04-21 10:53:15 +00:00
var IteratorIface = require ('./iterator-iface');
2016-09-26 09:28:47 +00:00
var Model = require ('./model');
2017-04-21 10:53:15 +00:00
/**
* A light iterator for models.
*/
2016-09-26 09:28:47 +00:00
module.exports = new Class
2015-07-03 05:49:45 +00:00
({
2017-04-21 10:53:15 +00:00
Extends: Vn.Object
,Implements: IteratorIface
2017-04-08 11:42:27 +00:00
,Properties:
2015-07-03 05:49:45 +00:00
{
/**
* The model associated to this form.
2016-12-20 09:32:17 +00:00
*/
2015-07-03 05:49:45 +00:00
model:
2017-04-21 10:53:15 +00:00
{
2016-09-26 09:28:47 +00:00
type: Model
2017-04-21 10:53:15 +00:00
,set: function (x)
{
this._model = x;
}
,get: function ()
{
return this._model;
}
2015-07-03 05:49:45 +00:00
},
/**
* The row where the form positioned, has -1 if the row is unselected.
2016-12-20 09:32:17 +00:00
*/
2015-07-03 05:49:45 +00:00
row:
2017-04-21 10:53:15 +00:00
{
2015-07-03 05:49:45 +00:00
type: Number
2017-04-21 10:53:15 +00:00
,set: function (x)
{
this._row = x;
}
,get: function ()
{
return this._row;
}
2015-07-03 05:49:45 +00:00
},
/**
* The number of rows in the form.
2016-12-20 09:32:17 +00:00
*/
2015-07-03 05:49:45 +00:00
numRows:
{
type: Number
2017-04-21 10:53:15 +00:00
,get: function ()
{
return this._model ?
this._model.numRows : 0;
}
},
/**
* Checks if the form data is ready.
*/
ready:
{
type: Boolean
,get: function ()
{
return this._model ?
this._model.ready : false;
}
2015-07-03 05:49:45 +00:00
},
2017-04-08 11:42:27 +00:00
/**
* The current row parameters.
*/
params:
{
type: Object
,set: function (x)
{
this.assign (x);
}
,get: function ()
{
2017-04-21 10:53:15 +00:00
return this.getParams ();
2017-04-08 11:42:27 +00:00
}
2015-07-03 05:49:45 +00:00
}
}
});