|
本帖最后由 qweasdzxc 于 2017-11-13 14:22 编辑
我的grid里有一列要动态显示这一行数据从创建时间开始(有字段存储)到现在系统时间位置的时差,我怎么建这个定时器来动态显示grid每行数据的时差?
怎么些方法传参到定时器里?我用下面的方法,无法获取到参数。rowID,beginTime- Model.prototype.grid1CellRender = function(event){
- if(event.colName="fSC"){
- var beginTime=new Date(event.row.row.fCJSJ.value.latestValue);
- var rowID=event.rowID;
- event.html="<div id='"+rowID+"'></div>";
- this.setTime(rowID,beginTime);
- }
- };
- Model.prototype.setTime = function(rowID,beginTime){
- setInterval(function(rowID,beginTime){
- debugger
- }, 1000);
- };
复制代码
后来我用下图的方法筒组件模式,前台报错
- Uncaught TypeError: Unable to process binding "with: function (){return comp('grid1').getCellEditorsBindingObject() }"
- Message: Unable to process binding "text: function (){return $model.setTime( val("XL_LXB"),val("fCJSJ")) }"
- Message: this.getRow(...).val is not a function;
- View: $model/UI2/XL/CS/process/wpxx/mainActivity.w?activity=mainActivity&process=%2FXL%2FCS%2Fprocess%2Fwpxx%2FwpxxProcess&bsessionid=200FFF39411BE4FA16C31F5D16B6554A;
- at n.val (eval at <anonymous> (core.min.js:71), <anonymous>:213:322052)
- at text (eval at parseBindingsString (core.min.js:71), <anonymous>:3:171)
- at update (core.min.js:71)
- at d.function.u.dependentObservable.disposeWhenNodeIsRemoved [as readFunction] (core.min.js:71)
- at d.evaluateImmediate (core.min.js:71)
- at d (core.min.js:71)
- at Object.u.computed.u.dependentObservable (core.min.js:71)
- at core.min.js:71
- at Object.arrayForEach (core.min.js:71)
- at l (core.min.js:71)
复制代码
|
-
|