[ 1 post ]

Jason House

  • Username: jhouse
  • Joined: Tue May 17, 2011 12:01 pm
  • Posts: 1
  • Offline
  • Profile

Refresh DataTable after row update

Post Posted: Tue May 17, 2011 1:42 pm
+0-
I am using a datatable to display data from an xml file I am loading into an array. I have added a text input at the bottom to do a search in a second xml file to load in a node with the matching account number. I can't seem to get the datatable to refresh after the new xml node is added into the array. I know it is adding the row to the array through various alert tests. I am running under IE9 standards mode, but will also need it working under IE7.

Below is how I add to the array from the xml file, originally load the datatable and am trying to refresh.


Code:

   function updateTable(){
         dtJasonX.refreshView();
      };
      
      var parseParent = function parseParentXml(xml) {

         //The counter for adding each new xml node to the array
         var counter = 0;
         //find every memberaccount node in the xml
         $(xml).find("memberaccount").each( function() {
            
            //Set the child values in the array
            xmlData[counter] = {
               accountnumber:$(this).find("accountnumber").text(),
               accountname:$(this).find("accountname").text()
            };
            
            dbxValue[counter] = 'preserve';
            
            counter++;
         });
         
         xmlData[counter] = {accountnumber:"<input type='text' name='accountname' id='accountnameinput' onBlur='findAccount(this.value)'/>"};
      };

   YUI(/*{ filter: 'raw' }*/{filter:"raw"}).use("datatable-scroll", function (Y) {

      initialize();
      
      dtJasonX = new Y.DataTable.Base({
         columnset: cols,
         recordset: xmlData,
         summary: "X axis scrolling table"
      });
      dtJasonX.plug(Y.Plugin.DataTableScroll, {
         width: "800px"
      });
      dtJasonX.render("#jason-x");
      
      
   });

  [ 1 post ]
Display posts from previous:  Sort by  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum