public/javascripts/inputex/js/widgets/DataTable.js
function() {
      
      var columndefs = this.setColumnDefs();

		/**
		 * YUI's datatable instance
		 */
      this.datatable = new YAHOO.widget.DataTable(this.element, columndefs, this.options.datasource, this.options.datatableOpts);
      this.datatable.subscribe('cellClickEvent', this._onCellClick, this, true);

		// Automatically set up the paginator
		if(this.options.datatableOpts && this.options.datatableOpts.paginator) {
			this.datatable.handleDataReturnPayload = function(oRequest, oResponse, oPayload) {
				if(oPayload) {
	        		oPayload.totalRecords = oResponse.meta.totalRecords;
				}
	        	return oPayload;
	    	};
		}
            
      // Insert button
      if ( this.options.allowInsert ){
         this.insertButton = inputEx.cn('input', {type:'button', value:msgs.insertItemText}, null, null);
         Event.addListener(this.insertButton, 'click', this.onInsertButton, this, true);
         this.options.parentEl.appendChild(this.insertButton);
      }

		
      // Set up editing flow
      var highlightEditableCell = function(oArgs) {
          var elCell = oArgs.target;
          if(Dom.hasClass(elCell, "yui-dt-editable") || Dom.hasClass(elCell,"yui-dt-col-delete") || Dom.hasClass(elCell,"yui-dt-col-modify") ) {
              this.highlightCell(elCell);
          }
      };
		
		// Locals
		this.datatable.set("MSG_LOADING", msgs.loadingText );
		this.datatable.set("MSG_EMPTY", msgs.emptyDataText );
		this.datatable.set("MSG_ERROR", msgs.errorDataText );

      this.datatable.subscribe("cellMouseoverEvent", highlightEditableCell);
      this.datatable.subscribe("cellMouseoutEvent", this.datatable.onEventUnhighlightCell);

   }
function() {
      
      var columndefs = this.setColumnDefs();

		/**
		 * YUI's datatable instance
		 */
      this.datatable = new YAHOO.widget.DataTable(this.element, columndefs, this.options.datasource, this.options.datatableOpts);
      this.datatable.subscribe('cellClickEvent', this._onCellClick, this, true);

		// Automatically set up the paginator
		if(this.options.datatableOpts && this.options.datatableOpts.paginator) {
			this.datatable.handleDataReturnPayload = function(oRequest, oResponse, oPayload) {
				if(oPayload) {
	        		oPayload.totalRecords = oResponse.meta.totalRecords;
				}
	        	return oPayload;
	    	};
		}
            
      // Insert button
      if ( this.options.allowInsert ){
         this.insertButton = inputEx.cn('input', {type:'button', value:msgs.insertItemText}, null, null);
         Event.addListener(this.insertButton, 'click', this.onInsertButton, this, true);
         this.options.parentEl.appendChild(this.insertButton);
      }

		
      // Set up editing flow
      var highlightEditableCell = function(oArgs) {
          var elCell = oArgs.target;
          if(Dom.hasClass(elCell, "yui-dt-editable") || Dom.hasClass(elCell,"yui-dt-col-delete") || Dom.hasClass(elCell,"yui-dt-col-modify") ) {
              this.highlightCell(elCell);
          }
      };
		
		// Locals
		this.datatable.set("MSG_LOADING", msgs.loadingText );
		this.datatable.set("MSG_EMPTY", msgs.emptyDataText );
		this.datatable.set("MSG_ERROR", msgs.errorDataText );

      this.datatable.subscribe("cellMouseoverEvent", highlightEditableCell);
      this.datatable.subscribe("cellMouseoutEvent", this.datatable.onEventUnhighlightCell);

   }
function ( ) { var columndefs = this . setColumnDefs ( ) ; /**
		 * YUI's datatable instance
		 */ this . datatable = new YAHOO . widget . DataTable ( this . element , columndefs , this . options . datasource , this . options . datatableOpts ) ; this . datatable . subscribe ( 'cellClickEvent' , this . _onCellClick , this , true ) ; // Automatically set up the paginator if ( this . options . datatableOpts && this . options . datatableOpts . paginator ) { this . datatable . handleDataReturnPayload = function ( oRequest , oResponse , oPayload ) { if ( oPayload ) { oPayload . totalRecords = oResponse . meta . totalRecords ; } return oPayload ; } ; } // Insert button if ( this . options . allowInsert ) { this . insertButton = inputEx . cn ( 'input' , { type : 'button' , value : msgs . insertItemText } , null , null ) ; Event . addListener ( this . insertButton , 'click' , this . onInsertButton , this , true ) ; this . options . parentEl . appendChild ( this . insertButton ) ; } // Set up editing flow var highlightEditableCell = function ( oArgs ) { var elCell = oArgs . target ; if ( Dom . hasClass ( elCell , "yui-dt-editable" ) || Dom . hasClass ( elCell , "yui-dt-col-delete" ) || Dom . hasClass ( elCell , "yui-dt-col-modify" ) ) { this . highlightCell ( elCell ) ; } } ; // Locals this . datatable . set ( "MSG_LOADING" , msgs . loadingText ) ; this . datatable . set ( "MSG_EMPTY" , msgs . emptyDataText ) ; this . datatable . set ( "MSG_ERROR" , msgs . errorDataText ) ; this . datatable . subscribe ( "cellMouseoverEvent" , highlightEditableCell ) ; this . datatable . subscribe ( "cellMouseoutEvent" , this . datatable . onEventUnhighlightCell ) ; }
Render the datatable
Render the datatable