首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > Web前端 >

把函数作为参数传面交函数,实现查找功能

2012-09-17 
把函数作为参数传递给函数,实现查找功能?/**?????? * get the cell by the id of the? widget that column

把函数作为参数传递给函数,实现查找功能

?/**
?????? * get the cell by the id of the? widget that column bounded.
?????? * @param wid the id of the bounded widget.
?????? */
????? me.getCellById = function (wid){
??? ??? ? var okCell;
??? ??? ? me.foreachCell(function (cell){
??? ??? ??? ?? if(cell.cellWidget && cell.cellWidget.id==wid){
??? ??? ??? ??? ?? okCell = cell;
??? ??? ??? ?? }
??? ??? ? });
??? ??? ? return okCell;
????? };
?????
????? me.foreachCell = function(fn){
??? ??? ??? var cells = me.getAllCells();
??????????? for(var n = 0,len = cells.length;n<len;n++){
??? ??? ??? ??? (fn)(cells[n]);
??? ??? ??? }
??? ? };

热点排行