/* * SOFTTEK VALORES CORPORATIVOS S.A. DE C.V. (SOFTTEK) * COPYRIGHT 2008(C) * * 1. MENSAJE LEGAL * EL USO Y DECOMPILACION DEL CODIGO Y LIBRERIAS CONTENIDO EN ESTA DISTRIBUCION * ESTA LIMITADO EXCLUSIVAMENTE PARA SOFTTEK Y SUS CLIENTES POR LO QUE * QUEDA LEGALMENTE PROHIBIDO HACER USO DE CUALQUIER ARTEFACTO POR CUALQUIER * OTRA PERSONA FISICA O MORAL A MENOS QUE SOFTTEK LO ACREDITE POR ESCRITO PARA HACERLO. */ DIALOG_FORM_SUFFIX = "Form"; ADD_REQUEST_FORM_SUFFIX = "AddRequestForm"; EDIT_REQUEST_FORM_SUFFIX = "EditRequestForm"; DELETE_REQUEST_FORM_SUFFIX = "DeleteRequestForm"; ADD_REQUEST_URL_SUFFIX = "AddRequestUrl"; EDIT_REQUEST_URL_SUFFIX = "EditRequestUrl"; DELETE_REQUEST_URL_SUFFIX = "DeleteRequestUrl"; ON_BEFORE_ADD_REQUEST_SUFFIX = "OnBeforeAddRequest"; ON_BEFORE_EDIT_REQUEST_SUFFIX = "OnBeforeEditRequest"; ON_BEFORE_DELETE_REQUEST_SUFFIX = "OnBeforeDeleteRequest"; formatGridDate = function(inDatum){ return dojo.date.locale.format(new Date(inDatum), {selector:'date', datePattern:'dd/MM/yyyy'}); } // a grid layout is an array of views. function displayGridCellData(grid){ alert(grid.model.getDatum(0,0)); alert("Data Rows: " + simpleGrid.model.getRowCount()); alert("Data Cols: " + simpleGrid.model.getColCount()); } //Limit its use (slow) function addDataArrayAsRow(grid,dataArray){ grid.addRow(dataArray); } //Limit its use (slow) function addDoubleArrayAsRows(grid, doubleArray){ for( i = doubleArray.length - 1 ; i >= 0 ; i--){ addDataArrayAsRow(grid,doubleArray[i]) } } function addUpdateInputHiddenToForm(formId, name, value, inputId){ var inputHidden = document.getElementById(inputId) if(inputHidden == null){ var inputHiddenElem = document.createElement("INPUT"); inputHiddenElem.type = "hidden"; inputHiddenElem.name = name; inputHiddenElem.value = value; inputHiddenElem.id = inputId; document.getElementById(formId).appendChild(inputHiddenElem); } else { inputHidden.value = value; } } function addUpdatePaginationHiddenValuesToForm(formId, offset, pageSize, dataSetName, attributeNames, gridId){ //offset="+offset+ addUpdateInputHiddenToForm(formId, "offset", offset, gridId+"FormOffset"); //"&pageSize="+pageSize+ addUpdateInputHiddenToForm(formId, "pageSize", pageSize, gridId+"FormPageSize" ); //"&dataSetName="+dataSetName addUpdateInputHiddenToForm(formId, "dataSetName", dataSetName, gridId+"FormDataSetName"); //+"&attributeNames="+fieldAttibutes addUpdateInputHiddenToForm(formId, "attributeNames", attributeNames, gridId+"FormAttributeNames"); } //returns true if the message success is true /*function requestPostForm(formId, requestUrl, timeout, errorMessage, options){ var transactionSuccessful; dojo.xhrPost( { url: requestUrl, handleAs: "json", form: formId, headers: {'X-Requested-With': 'XMLHttpRequest'}, load: function(responseObject, ioArgs) { if(!responseObject.isSuccessful){ alert(errorMessage + "["+responseObject.message+"]"); transactionSuccessful = false; } else { transactionSuccessful = true; if (options.onSuccess) { options.onSuccess.call(); } } }, timeout: timeout, error: function(response, ioArgs) { //alert(ioArgs) //alert(response) //alert("Error HTTP status code: " + ioArgs.xhr.status); alert(errorMessage) transactionSuccessful = false; } }); return transactionSuccessful; }*/ function getDataPage(grid, url, dataSetName, offset, pageSize, timeout, errorMessage, postGridDataProcessor, requestedPage, gridControl, fieldAttibutes,fieldTypes){ Stk.ajax({ url: url, content: {offset: offset, pageSize: pageSize, dataSetName: dataSetName, attributeNames: fieldAttibutes}, timeout: GRID_TIMEOUT_MSEC, errorMsg: GRID_DEFAULT_ERROR_MSG, onSuccess: function(responseObject) { gridControl.totalCount = responseObject.totalCount; if(gridControl.onBeforeLoadData!=null && gridControl.onBeforeLoadData!="") eval(gridControl.onBeforeLoadData); deshabilitarButons(false); var valores=fieldAttibutes.split("|"); identif=valores[0]; var formatstore=FormatGridStore(responseObject.data, valores, fieldTypes); var op=eval(formatstore); var qo=new Object(); qo.items=op store1= new dojo.data.ItemFileWriteStore({data: qo}); grid.setStore(store1); postGridDataProcessor(requestedPage, gridControl, responseObject.totalCount); }, onError: function(){ var noDataStructure = {cells: [[{name: errorMessage}]]}; grid.setStructure([noDataStructure]); grid.render(); } }); /*dojo.xhrGet( { url: url + "?offset="+offset+"&pageSize="+pageSize+"&dataSetName="+dataSetName+"&attributeNames="+fieldAttibutes, handleAs: "json", load: function(responseObject, ioArgs) { if(!responseObject.isSuccessful){ alert(errorMessage + "["+responseObject.message+"]"); var noDataStructure = { cells: [[ {name: errorMessage} ]] }; var noDataLayout = [ noDataStructure ]; grid.setStructure(noDataLayout); grid.render(); return; } else { grid.setModel(new dojox.grid.data.Table(null, responseObject.data)) postGridDataProcessor(requestedPage, gridControl); //return responseObject; } }, timeout: timeout, error: function(response, ioArgs) { //alert(response) //alert("Error HTTP status code: " + ioArgs.xhr.status); alert(errorMessage) return response; } });*/ } /**Use this to post a form with any information. At least the form must contain the parameters: * dataSetName, offset, pageSize and the attribute names as attibuteNames*/ function postFormForDataPage(grid, url, dataSetName, offset, pageSize, timeout, errorMessage, postGridDataProcessor, requestedPage, gridControl, attributeNames, formId, fieldTypes){ addUpdatePaginationHiddenValuesToForm(formId, offset, pageSize, dataSetName, attributeNames, gridControl.gridId) deshabilitarButons(true); Stk.ajax({ url: url, //content: {offset: offset, pageSize: pageSize, dataSetName: dataSetName, attributeNames: fieldAttibutes}, formId: formId, timeout: GRID_TIMEOUT_MSEC, errorMsg: GRID_DEFAULT_ERROR_MSG, onSuccess: function(responseObject) { gridControl.totalCount = responseObject.totalCount; if(gridControl.onBeforeLoadData!=null && gridControl.onBeforeLoadData!="") eval(gridControl.onBeforeLoadData); deshabilitarButons(false); var valores=attributeNames.split("|"); identif=valores[0]; var formatstore=FormatGridStore(responseObject.data, valores, fieldTypes); var op=eval(formatstore); var qo=new Object(); qo.items=op store1= new dojo.data.ItemFileWriteStore({data: qo}); grid.setStore(store1); postGridDataProcessor(requestedPage, gridControl, responseObject.totalCount); }, onError: function(){ deshabilitarButons(false); var noDataStructure = {cells: [[{name: errorMessage}]]}; grid.setStructure([noDataStructure]); grid.render(); } }); /*dojo.xhrPost( { url: url, handleAs: "json", form: formId, load: function(responseObject, ioArgs) { if(!responseObject.isSuccessful){ alert(errorMessage + "["+responseObject.message+"]"); var noDataStructure = { cells: [[ {name: errorMessage} ]] }; var noDataLayout = [ noDataStructure ]; grid.setStructure(noDataLayout); grid.render(); return; } else { grid.setModel(new dojox.grid.data.Table(null, responseObject.data)) postGridDataProcessor(requestedPage, gridControl, responseObject.totalCount); //return responseObject; } }, timeout: timeout, error: function(response, ioArgs) { //alert(response) //alert("Error HTTP status code: " + ioArgs.xhr.status); alert(errorMessage) return response; } });*/ } function FormatGridStore(stringWithoutFormat, valores, fieldTypes){ var tipos=fieldTypes; result="items: ["; for (i=0;i"); if (j==0 && i==0) { identif=valores[0]; lab=valores[0]; } if (tipos[j]=="int") { result=result+' \''+valores[j]+'\': '+row[j]+' '; }else { result=result+' \''+valores[j]+'\':\''+row[j]+'\''; } if (j!=(row.length-1)) { result=result+','; } } result=result+'}'; if (i!=(stringWithoutFormat.length-1)) { result=result+','; } }; result=result+']'; return result; } /**This is the grid control */ function GridControl(theGrid, dataSetName, pageSize, theTotalCount, fieldAttributes, addRowFromObjectFunction, fieldTypes, requiresPagination, colCount, requestUrl, useFormId, multiSelect,onBeforeLoadData) { this.requiresPagination = requiresPagination; this.dataSetName = dataSetName; this.addRowFromObject = addRowFromObjectFunction; this.isDataDisplayed = false; this.gridId = theGrid.stkId; this.gridModel = theGrid.model this.colCount = colCount this.fieldAttributes = fieldAttributes; this.fieldTypes = fieldTypes.split("|") this.grid = theGrid; this.gridDialog = eval(this.gridId+"Dialog") this.grid.gridControl = this; this.pageSize = pageSize; this.currentOffset = 0; //always first this.totalCount = theTotalCount; this.totalPages = Math.ceil(this.totalCount/this.pageSize); this.lastOffset = (this.totalPages * this.pageSize) - this.pageSize; this.currentPage = 1; //always first this.nextPage = (this.currentPage + 1) <= this.totalPages ? this.currentPage + 1 : this.currentPage; this.previousPage = (this.currentPage - 1) <= 1? 1 :this.currentPage - 1; this.nextOffset = (this.currentPage * this.pageSize) >= this.totalCount? this.currentOffset: this.currentPage * this.pageSize; this.previousOffset = (((this.previousPage) * this.pageSize - this.pageSize) < 0 ) ? 0 : (this.previousPage * this.pageSize - this.previousPage) this.state = "NO_ENTRIES"; this.requestUrl = requestUrl; this.useFormId = useFormId; this.useGetMethod = (useFormId == null || useFormId == ""); this.multiSelect = multiSelect; //convention over configuration: if these defined a post will be executed for forms with the id pattern [Add|Delete|Edit]RequestForm try {this.onAddRequestUrl = eval(this.gridId + ADD_REQUEST_URL_SUFFIX);} catch (err) { this.onAddRequestUrl = null; } try {this.onDeleteRequestUrl = eval(this.gridId + DELETE_REQUEST_URL_SUFFIX);} catch (err) { this.onDeleteRequestUrl = null } try { this.onEditRequestUrl = eval(this.gridId + EDIT_REQUEST_URL_SUFFIX); } catch (err) { this.onEditRequestUrl = null } //These can be redefined at runtime if want to switch form information this.onAddRequestForm = document.getElementById(this.gridId + DIALOG_FORM_SUFFIX); this.onEditRequestForm = document.getElementById(this.gridId + DIALOG_FORM_SUFFIX); this.onDeleteRequestForm = document.getElementById(this.gridId + DELETE_REQUEST_FORM_SUFFIX); //these can be set at runtime to add custom functionality before submitting, for example to add form data this.onBeforeAddRequest = null; this.onBeforeEditRequest = null; this.onBeforeDeleteRequest = null; this.onBeforeLoadData = onBeforeLoadData; this.recalcOnNewPage = function(){ this.currentOffset = this.currentPage * this.pageSize - this.pageSize; //recalc when new offset this.totalPages = Math.ceil(this.totalCount/this.pageSize); this.nextPage = (this.currentPage + 1) <= this.totalPages ? this.currentPage + 1 : this.currentPage; this.previousPage = (this.currentPage - 1) <= 1? 1 :this.currentPage - 1; this.nextOffset = (this.currentPage * this.pageSize) >= this.totalCount? this.currentOffset: this.currentPage * this.pageSize; this.previousOffset = (((this.previousPage) * this.pageSize - this.pageSize) < 0 ) ? 0 : (this.previousPage * this.pageSize - this.pageSize); this.lastOffset = (this.totalPages * this.pageSize) - this.pageSize; this.state = "WITH_ENTRIES"; } this.howManyRows = function(){ return this.gridModel.getRowCount(); } this.selectUnselectAllRows = function(setSelected){ if( this.howManyRows() < 0){ return; }else { for(var i = 0; i < this.howManyRows();i++){ this.grid.selection.setSelected(i, setSelected); } } } this.updateLabels = function() { document.getElementById(this.gridId + 'CurrentPageDisp').innerHTML = this.currentPage; document.getElementById(this.gridId + 'TotalPagesDisp').innerHTML = this.totalPages; }; this.dataSuccessProcessorCallback = function (requestedPage, gridControl, totalCount){ gridControl.totalCount = totalCount; gridControl.currentPage = requestedPage; gridControl.isDataDisplayed = true; gridControl.recalcOnNewPage(); gridControl.updateLabels(); gridControl.togglePaginationRenderNoEntries(); } this.browseNextPage = function (){ if(this.useGetMethod){ getDataPage(this.grid, this.requestUrl, this.dataSetName, this.nextOffset, this.pageSize, GRID_TIMEOUT_MSEC, GRID_DEFAULT_ERROR_MSG, this.dataSuccessProcessorCallback,this.nextPage,this.grid.gridControl, this.fieldAttributes, this.fieldTypes); } else { postFormForDataPage(this.grid, this.requestUrl, this.dataSetName, this.nextOffset,this.pageSize, GRID_TIMEOUT_MSEC, GRID_DEFAULT_ERROR_MSG, this.dataSuccessProcessorCallback, this.nextPage, this.grid.gridControl, this.fieldAttributes, this.useFormId, this.fieldTypes); } } ; this.browsePreviousPage = function (){ if(this.useGetMethod){ getDataPage(this.grid, this.requestUrl, this.dataSetName, this.previousOffset, this.pageSize, GRID_TIMEOUT_MSEC, GRID_DEFAULT_ERROR_MSG, this.dataSuccessProcessorCallback,this.previousPage,this.grid.gridControl, this.fieldAttributes, this.fieldTypes); } else { postFormForDataPage(this.grid, this.requestUrl, this.dataSetName, this.previousOffset,this.pageSize, GRID_TIMEOUT_MSEC, GRID_DEFAULT_ERROR_MSG, this.dataSuccessProcessorCallback, this.previousPage, this.grid.gridControl, this.fieldAttributes, this.useFormId, this.fieldTypes); } }; this.browseCurrentPage = function(){ if(this.useGetMethod){ getDataPage(this.grid, this.requestUrl, this.dataSetName, this.currentOffset, this.pageSize, GRID_TIMEOUT_MSEC, GRID_DEFAULT_ERROR_MSG, this.dataSuccessProcessorCallback,this.currentPage,this.grid.gridControl, this.fieldAttributes, this.fieldTypes); } else { postFormForDataPage(this.grid, this.requestUrl, this.dataSetName, this.currentOffset,this.pageSize, GRID_TIMEOUT_MSEC, GRID_DEFAULT_ERROR_MSG, this.dataSuccessProcessorCallback, this.currentPage, this.grid.gridControl, this.fieldAttributes, this.useFormId, this.fieldTypes); } }; this.browseFirstPage = function(){ if(this.useGetMethod){ getDataPage(this.grid, this.requestUrl, this.dataSetName, 0, this.pageSize, GRID_TIMEOUT_MSEC, GRID_DEFAULT_ERROR_MSG, this.dataSuccessProcessorCallback,1,this.grid.gridControl, this.fieldAttributes, this.fieldTypes); } else { postFormForDataPage(this.grid, this.requestUrl, this.dataSetName, 0,this.pageSize, GRID_TIMEOUT_MSEC, GRID_DEFAULT_ERROR_MSG, this.dataSuccessProcessorCallback, 1, this.grid.gridControl, this.fieldAttributes, this.useFormId, this.fieldTypes); } this.togglePaginationRenderNoEntries(); }; this.browseLastPage = function(){ if(this.useGetMethod){ getDataPage(this.grid, this.requestUrl, this.dataSetName,this.lastOffset, this.pageSize, GRID_TIMEOUT_MSEC, GRID_DEFAULT_ERROR_MSG, this.dataSuccessProcessorCallback,this.totalPages,this.grid.gridControl, this.fieldAttributes, this.fieldTypes); } else { postFormForDataPage(this.grid, this.requestUrl, this.dataSetName, this.lastOffset,this.pageSize, GRID_TIMEOUT_MSEC, GRID_DEFAULT_ERROR_MSG, this.dataSuccessProcessorCallback, this.totalPages, this.grid.gridControl, this.fieldAttributes, this.useFormId, this.fieldTypes); } }; this.hasNextPage = function(){ return this.currentPage + 1 <= this.totalPages; }; this.hasPreviousPage = function(){ return ( (this.currentPage - 1) > 0); }; /***/ this.editSelectedRow = function(){ var selRow = this.grid.selection.getFirstSelected(); if(selRow < 0){ alert(GRID_SELECT_FIRST_MSG); return; } else { this.fillDialogFromRow(); this.gridDialog.show() this.state = "EDITING"; } }; this.fillDialogFromRow = function(){ var selRow = this.grid.selection.getFirstSelected(); var dialogData = this.gridDialog.attr('value') for(var selCol = 0; selCol < this.colCount; selCol++){ var cellData = this.gridModel.getDatum(selRow, selCol) var inputField = dojo.byId(this.gridId + "_columnField"+selCol); if(this.fieldTypes[selCol] == "boolean"){ checkBoxObj = eval(this.gridId + "_columnField"+selCol) checkBoxObj.setValue(cellData); } else if(this.fieldTypes[selCol] == "date"){ dateTextBox = eval(this.gridId + "_columnField"+selCol) dateTextBox.setValue(cellData); } else { inputField.value = cellData } } } this.fillRowFromDialog = function(){ var selRow = this.grid.selection.getFirstSelected(); if(this.gridDialog.validate()){ var diaData = this.gridDialog.attr('value') for(var curCol = 0; curCol < this.colCount; curCol++){ var inputField = dojo.byId(this.gridId + "_columnField"+curCol); //this.gridModel.setDatum(inputField.value,selRow, curCol) if(this.fieldTypes[curCol] == "boolean"){ this.gridModel.setDatum(inputField.checked,selRow, curCol) } else if(this.fieldTypes[curCol] == "date"){ dateTextBox = eval(this.gridId + "_columnField"+curCol) this.gridModel.setDatum(dateTextBox.value,selRow, curCol) } else { this.gridModel.setDatum(inputField.value,selRow, curCol) } } } } /**Does a post if the delete url is defined otherwise deletes the row in the client only*/ this.removeSelectedRow = function(){ var selRow = this.grid.selection.getFirstSelected(); if(selRow < 0){ alert(GRID_SELECT_FIRST_MSG); return; }else if(confirm(GRID_REMOVE_MSG)){ if(this.onBeforeDeleteRequest != null ) { this.onBeforeDeleteRequest(); } var datum = this.gridModel.getDatum(selRow, 0); if(this.onDeleteRequestUrl != null){ var me = this; Stk.ajax({ url: me.onDeleteRequestUrl, content: {elemDelete: datum}, scope: me, timeout: GRID_TIMEOUT_MSEC, errorMsg: GRID_DEFAULT_ERROR_MSG, onSuccess: function() { this.grid.removeSelectedRows(); } }); } else {// if (this.onDeleteRequestUrl == null){ this.grid.removeSelectedRows(); } } this.postDelete() }; this.addRow = function(){ this.resetDialog(); this.state = "ADDING"; this.gridDialog.show() } this.isAdding = function(){ return this.state == "ADDING" } this.isEditing = function(){ return this.state == "EDITING"; } this.updateFromAdding = function(){ if(this.gridDialog.validate()){ //alert('submitted w/args:\n' + dojo.toJson(, true)); diaData = this.gridDialog.attr('value') this.addRowFromObject(this.grid, diaData); this.gridDialog.hide(); this.state = "WITH_ENTRIES"; } //checkAddRowFromDialogData(this.gridDialog, this.grid, this.addRowFromObject); } this.postDelete = function(){ if(this.howManyRows() <= 0){ //eval(this.gridId+"DeleteBtn").setDisabled(true); //eval(this.gridId+"EditBtn").setDisabled(true); //eval(this.gridId+"SelectAllBtn").setDisabled(true); //eval(this.gridId+"UnSelectAllBtn").setDisabled(true); document.getElementById(this.gridId + "NoResults").style["visibility"]="visible" } } this.postAdd = function(){ if(this.howManyRows() > 0){ //eval(this.gridId+"DeleteBtn").setDisabled(false); //eval(this.gridId+"EditBtn").setDisabled(false); //eval(this.gridId+"SelectAllBtn").setDisabled(false); //eval(this.gridId+"UnSelectAllBtn").setDisabled(false); document.getElementById(this.gridId + "NoResults").style["visibility"]="hidden" } } /**Does the request task and validates the result if the requestUrls are not defined it * does not makes the request*/ this.dispatchAfterDialogOK = function(){ if(this.isAdding()){ if(this.onBeforeAddRequest != null ) { this.onBeforeAddRequest(); } if(this.onAddRequestUrl != null){ var me = this; Stk.ajax({ url: me.onAddRequestUrl, formId: me.onAddRequestForm, scope: me, timeout: GRID_TIMEOUT_MSEC, errorMsg: GRID_DEFAULT_ERROR_MSG, onSuccess: function() { this.updateFromAdding(); this.postAdd(); } }); } else{ //if (this.onAddRequestUrl == null) { this.updateFromAdding(); this.postAdd(); }/* else { alert(GRID_DEFAULT_ERROR_MSG); }*/ }else if(this.isEditing()){ if(this.onBeforeEditRequest != null ) {this.onBeforeEditRequest();} if(this.onEditRequestUrl != null){ var me = this; Stk.ajax({ url: me.onAddRequestUrl, formId: me.onEditRequestForm, scope: me, timeout: GRID_TIMEOUT_MSEC, errorMsg: GRID_DEFAULT_ERROR_MSG, onSuccess: function() { this.fillRowFromDialog(); this.gridDialog.hide(); } }); } else {//if (this.onEditRequestUrl == null) { this.fillRowFromDialog(); this.gridDialog.hide(); }/* else { alert(GRID_DEFAULT_ERROR_MSG); }*/ } else { this.gridDialog.hide(); } } this.resetDialog = function(){ dojo.byId(this.gridId + DIALOG_FORM_SUFFIX).reset() } this.renderNoEntries = function(){ //this.oldGridLayout = dojo.byId("dojox_GridView_0").innerHTML //dojo.byId("dojox_GridView_0").innerHTML = "
"+GRID_NO_ENTRIES_MSG+"
" //eval(this.gridId+"DeleteBtn").setDisabled(true); //eval(this.gridId+"EditBtn").setDisabled(true); //eval(this.gridId+"SelectAllBtn").setDisabled(true); //eval(this.gridId+"UnSelectAllBtn").setDisabled(true); document.getElementById(this.gridId + "NoResults").style["visibility"]="visible" } this.togglePaginationRenderNoEntries = function(){ if(this.totalCount > 0){ dojo.byId(this.gridId +"PaginationBar").style["visibility"]="visible"; document.getElementById(this.gridId + "Title").style["visibility"]="visible"; document.getElementById(this.gridId + "NoResults").style["visibility"]="hidden"; document.getElementById(this.gridId).style["visibility"]="visible"; //document.getElementById(this.gridId).style["display"]="block"; } else { dojo.byId(this.gridId +"PaginationBar").style["visibility"]="hidden"; document.getElementById(this.gridId + "Title").style["visibility"]="hidden"; document.getElementById(this.gridId + "NoResults").style["visibility"]="visible"; document.getElementById(this.gridId).style["visibility"]="hidden"; //document.getElementById(this.gridId).style["display"]="none"; } } this.initialSetup = function() { this.grid.selection.multiSelect = this.multiSelect; if(this.requiresPagination){ this.updateLabels(); // dojo.byId(this.gridId +"PaginationBar").style["visibility"]="visible"; // dojo.byId(this.gridId +"BottomControl").style["visibility"]="hidden"; this.togglePaginationRenderNoEntries(); } else if(theTotalCount <= 0){ //dojo.byId(this.gridId +"BottomControl").style["visibility"]="visible"; this.state = "NO_ENTRIES"; this.renderNoEntries(); } else { //dojo.byId(this.gridId +"BottomControl").style["visibility"]="visible"; this.state = "WITH_ENTRIES"; } } this.cleanGrid = function (){ var formatstore="items: []" var op=eval(formatstore); var valores=this.fieldAttributes.split("|"); identif=valores[0]; var qi=new Object(); qi.items=op store1= new dojo.data.ItemFileWriteStore({data: qi}); this.grid.setStore(store1); //Estoy en duda de la siguiente linea:? //this.dataSuccessProcessorCallback(this.totalPages, this.grid.gridControl, 0); document.getElementById(this.gridId + "NoResults").style["visibility"]="visible" dojo.byId(this.gridId +"PaginationBar").style["visibility"]="hidden"; } this.initialSetup(); } function deshabilitarButons(estado){ var inputArray = document.getElementsByTagName("button"); for(var j=0; j ','\r\n').replace(/</g,'<').replace(/>/g,'>'); return dato; }