2011-08-31 17:39:24 +02:00
|
|
|
/**
|
|
|
|
* eGroupWare eTemplate2 - Class which contains a the data model
|
|
|
|
*
|
|
|
|
* @license http://opensource.org/licenses/gpl-license.php GPL - GNU General Public License
|
|
|
|
* @package etemplate
|
|
|
|
* @subpackage dataview
|
|
|
|
* @link http://www.egroupware.org
|
|
|
|
* @author Andreas Stöckel
|
|
|
|
* @copyright Stylite 2011
|
|
|
|
* @version $Id$
|
|
|
|
*/
|
|
|
|
|
|
|
|
"use strict"
|
|
|
|
|
|
|
|
/*egw:uses
|
|
|
|
et2_inheritance;
|
|
|
|
et2_dataview_interfaces;
|
|
|
|
*/
|
|
|
|
|
|
|
|
var et2_dataview_dataProvider = Class.extend({
|
|
|
|
|
2011-09-05 16:35:28 +02:00
|
|
|
init: function() {
|
|
|
|
this.updateQueue = 0;
|
|
|
|
},
|
|
|
|
|
2011-08-31 17:39:24 +02:00
|
|
|
getCount: function() {
|
2011-09-02 18:15:57 +02:00
|
|
|
return 10000;
|
2011-08-31 17:39:24 +02:00
|
|
|
},
|
|
|
|
|
2011-09-05 16:35:28 +02:00
|
|
|
registerDataRow: function(_dataRow, _idx) {
|
|
|
|
/* var row = {
|
2011-08-31 17:39:24 +02:00
|
|
|
"type": "dataRow",
|
|
|
|
"data": {
|
|
|
|
"ts_title": "Row " + _idx
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
// Get a random value which is used to simulate network latency and time
|
|
|
|
// it needs to load the data.
|
|
|
|
var rnd = Math.round(Math.random() * 1000);
|
|
|
|
|
|
|
|
if (rnd < 200)
|
|
|
|
{
|
|
|
|
_dataRow.updateData(row);
|
|
|
|
}
|
|
|
|
|
|
|
|
window.setTimeout(function() {_dataRow.updateData(row); },
|
2011-09-05 16:35:28 +02:00
|
|
|
Math.round(rnd / 2));*/
|
|
|
|
|
|
|
|
|
|
|
|
// All data rows are updated independently of all others - this allows
|
|
|
|
// user input between generation of the widgets.
|
2011-09-06 18:50:38 +02:00
|
|
|
//window.setTimeout(function() {_dataRow.updateData({"readonlys": {"__ALL__": true}});}, 0);
|
2011-09-07 18:59:23 +02:00
|
|
|
_dataRow.updateData({"content": {"ts_title": "Idx: " + _idx}});
|
2011-08-31 17:39:24 +02:00
|
|
|
},
|
|
|
|
|
|
|
|
unregisterDataRow: function(_dataRow) {
|
|
|
|
//
|
|
|
|
}
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|