YUI - update/set data table cell of selected row dynamically with diff. vals (XML)

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • SagarDoke
    New Member
    • Feb 2008
    • 24

    YUI - update/set data table cell of selected row dynamically with diff. vals (XML)

    hi all,

    i am using yui framework. in that i want to update or set datatable cell of selected row dynamically by different value. can anybody please tell me how to do that?
  • acoder
    Recognized Expert MVP
    • Nov 2006
    • 16032

    #2
    Post what code you've tried so far. Have you checked the documentation/examples?

    PS. please use good thread titles.

    Comment

    • SagarDoke
      New Member
      • Feb 2008
      • 24

      #3
      XML problem

      hi all,

      [CODE=xml]<?xml version="1.0"?>
      <Company>
      <employee>
      <name>Kedar</name>
      <cell>+91123456 7891</cell>
      <street>abc</street>
      </employee>
      <employee>
      <name>Sagar</name>
      <cell>+91123456 7891</cell>
      <street>abc</street>
      </employee>
      <employee>
      <name>Vaishak </name>
      <cell>+91123456 7891</cell>
      <street>xyz</street>
      </employee>
      </Company>
      [/CODE]
      this is my XML file "Test.xml".
      I wanted to fetch this record into the datatable using yui frame work. For that i have written a javascript code,

      [CODE=javascript]YAHOO.util.Even t.addListener(w indow, "load", function()
      {
      createFirstQueu erPanel();
      });

      var cd_closeAll = [
      {key:"name", label:"Name",so rtable:true,wid th:70,resizeabl e:false},
      {key:"cell", label:"Mob No.",sortable:t rue,width:45,re sizeable:false} ,
      {key:"street", label:"Addr", sortable:true,w idth:130,resize able:false},
      ];

      var getXML,dt_close ALL,btnShow;

      function createFirstQueu erPanel()
      {
      panel = new YAHOO.widget.Pa nel
      ('queuerClientS election', {
      draggable:false ,
      close: false,
      width: '250px',
      height:'400px',
      xy: [0, 0]
      });
      panel.setHeader ('Queuer Operations');
      panel.render();

      btnShow = new YAHOO.widget.Bu tton
      ({
      label:"Show",
      width:'20px',
      container:"show "
      });
      }

      YAHOO.util.Even t.on('show','cl ick', function()
      {
      connectionCallb ack =
      {
      success: function(o)
      {
      var xmlDoc = o.responseXML;
      alert(xmlDoc.ge tElementsByTagN ame("name")[0].childNodes[0].nodeValue);

      var ds_closeAll = new YAHOO.util.Data Source(xmlDoc);
      ds_closeAll.res ponseType = YAHOO.util.Data Source.TYPE_XML ;
      ds_closeAll.res ponseSchema =
      {
      resultsList: "employee",
      fields: ["name","cell"," street"]
      };

      dt_closeALL = new YAHOO.widget.Da taTable("queuer layout", cd_closeAll, ds_closeAll);
      }
      }

      getXML = YAHOO.util.Conn ect.asyncReques t("POST","Test. xml",connection Callback);
      });[/CODE]

      but problem is its not showing the data in datatable. is there any mistake in code? Please tell me as early as possible.
      Last edited by acoder; Apr 28 '08, 12:09 PM. Reason: Added code tags

      Comment

      • acoder
        Recognized Expert MVP
        • Nov 2006
        • 16032

        #4
        I've merged your threads.

        Please use [code] tags when posting code.

        Do you get any errors?

        Comment

        • SagarDoke
          New Member
          • Feb 2008
          • 24

          #5
          Originally posted by acoder
          I've merged your threads.

          Please use [code] tags when posting code.

          Do you get any errors?
          No, there is no any error. But values are not getting set into the datatable.

          Comment

          • acoder
            Recognized Expert MVP
            • Nov 2006
            • 16032

            #6
            See this example. Adapt it for your application.

            Comment

            Working...