Loading ...
Sorry, an error occurred while loading the content.

DataTable : How to get data in js array

Expand Messages
  • Ryan V. Bayona
    Hi, i ve been following the basic examples in using the DataTable. So far so good, i have the following questions by the way. Hope the gurus here can enlighten
    Message 1 of 3 , Dec 2, 2007
    • 0 Attachment
      Hi,
      i've been following the basic examples in using the DataTable. So far
      so good, i have the following questions by the way. Hope the gurus
      here can enlighten me . :)

      1. How can i get the data in the js array once i clicked on the Row?
      on the examples,it says:

      myDataTable.subscribe("rowClickEvent",
      myDataTable.onEventSelectRow);

      My goal is get the contents of this row in the Datasource..

      2. How can i delete or remove items in the datasource?
      For example, i have a multi-select row in my table and i have a
      button "delete selected items" which when clicked will delete the
      selection from the table, and the datasource.

      3. How can i submit the DataSource to the server so i can process it
      on the server side..( im using PHP,, just the submit method will do i
      can view it on PHP anyway)

      Thats it for now.. thank you so much!

      -Ryan
    • Ryan V. Bayona
      ... in response to number 2, the DataTable.deleteRows method is not working for me : //if clicked, it will delete the selected rows
      Message 2 of 3 , Dec 2, 2007
      • 0 Attachment
        --- In ydn-javascript@yahoogroups.com, "Ryan V. Bayona" <r2b2_ry@...>
        wrote:
        >
        > Hi,
        > i've been following the basic examples in using the DataTable. So far
        > so good, i have the following questions by the way. Hope the gurus
        > here can enlighten me . :)
        >
        > 1. How can i get the data in the js array once i clicked on the Row?
        > on the examples,it says:
        >
        > myDataTable.subscribe("rowClickEvent",
        > myDataTable.onEventSelectRow);
        >
        > My goal is get the contents of this row in the Datasource..
        >
        > 2. How can i delete or remove items in the datasource?
        > For example, i have a multi-select row in my table and i have a
        > button "delete selected items" which when clicked will delete the
        > selection from the table, and the datasource.
        >
        > 3. How can i submit the DataSource to the server so i can process it
        > on the server side..( im using PHP,, just the submit method will do i
        > can view it on PHP anyway)
        >
        > Thats it for now.. thank you so much!
        >
        > -Ryan
        >

        in response to number 2, the DataTable.deleteRows method is not
        working for me :
        //if clicked, it will delete the selected rows
        <a href="#" onclick="javascript:deleteItem()">delete item</a>


        function deleteItem()
        {

        myDataTable.deleteRows(myDataTable.getSelectedRows);

        }

        its not doing anything at all.. is there something i did wrong?
      • jennykhan
        Hi Ryan, That should probably be: myDataTable.deleteRows(myDataTable.getSelectedRows()); Check out this blog article for a good background on working with
        Message 3 of 3 , Dec 4, 2007
        • 0 Attachment
          Hi Ryan,

          That should probably be:

          myDataTable.deleteRows(myDataTable.getSelectedRows());

          Check out this blog article for a good background on working with
          DataTable for round trips to your server:

          http://yuiblog.com/blog/2007/09/26/satyam-datatable-2/

          Regards,
          Jenny






          --- In ydn-javascript@yahoogroups.com, "Ryan V. Bayona" <r2b2_ry@...>
          wrote:
          >
          > --- In ydn-javascript@yahoogroups.com, "Ryan V. Bayona" <r2b2_ry@>
          > wrote:
          > >
          > > Hi,
          > > i've been following the basic examples in using the DataTable. So far
          > > so good, i have the following questions by the way. Hope the gurus
          > > here can enlighten me . :)
          > >
          > > 1. How can i get the data in the js array once i clicked on the Row?
          > > on the examples,it says:
          > >
          > > myDataTable.subscribe("rowClickEvent",
          > > myDataTable.onEventSelectRow);
          > >
          > > My goal is get the contents of this row in the Datasource..
          > >
          > > 2. How can i delete or remove items in the datasource?
          > > For example, i have a multi-select row in my table and i have a
          > > button "delete selected items" which when clicked will delete the
          > > selection from the table, and the datasource.
          > >
          > > 3. How can i submit the DataSource to the server so i can process it
          > > on the server side..( im using PHP,, just the submit method will do i
          > > can view it on PHP anyway)
          > >
          > > Thats it for now.. thank you so much!
          > >
          > > -Ryan
          > >
          >
          > in response to number 2, the DataTable.deleteRows method is not
          > working for me :
          > //if clicked, it will delete the selected rows
          > <a href="#" onclick="javascript:deleteItem()">delete item</a>
          >
          >
          > function deleteItem()
          > {
          >
          > myDataTable.deleteRows(myDataTable.getSelectedRows);
          >
          > }
          >
          > its not doing anything at all.. is there something i did wrong?
          >
        Your message has been successfully submitted and would be delivered to recipients shortly.