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

Re: [ydn-javascript] Re: How to display the metaFields attributes in datatable?

Expand Messages
  • nagaraj
    yay! it worked thanks Luke ... From: y_lsmith Subject: [ydn-javascript] Re: How to display the metaFields attributes in datatable?
    Message 1 of 6 , Sep 10, 2009
    • 0 Attachment
      yay! it worked thanks Luke


      --- On Thu, 10/9/09, y_lsmith <lucas.e.smith@...> wrote:

      From: y_lsmith <lucas.e.smith@...>
      Subject: [ydn-javascript] Re: How to display the metaFields attributes in datatable?
      To: ydn-javascript@yahoogroups.com
      Date: Thursday, 10 September, 2009, 11:19 AM

       

      --- In ydn-javascript@ yahoogroups. com, "manne_swiss" <manne_swiss@ ...> wrote:
      >
      > Sorry here is the sample code structure
      >
      > {"xyzResponse" :{"xyzArray" :[{"id":0, "name":"zyx" ,address: "sdseee"} ,{"id":1, "name":"aaaa" ,address: "ssdsdee" }]},"needtoAcces sthis":"this_ is_the one"}
      >
      > where the "needtoAccessthis" is common for all the objects in the list.. and i need to display that for every field in the datatable..
      >
      > and i am framing the data source like below:
      >
      > myDataSource. responseSchema = {
      > resultsList: "xyzResponse. xyzArray" ,
      > fields: ["id","name" ,address] ,
      > metaFields: {something :"xyzResponse. this_is_the one" }
      > };
      >
      > and my column vals are like this
      > var myColumnDefs = [
      > {key:"id",label: "id",width: 30,resizeable: true,sortable: true},
      > {key:"name", label:"name" ,width:30, resizeable: true,sortable: true},
      > {key:"address" ,label:"address" ,width:30, resizeable: true,sortable: true},
      > {key:"",label: "",width: 30,resizeable: true,sortable: true}//here i got stucked..how i need to get the key...
      > ];
      >
      >
      > Thanks in advance!
      >
      >
      >
      >
      >
      > --- In ydn-javascript@ yahoogroups. com, "y_lsmith" <lucas.e.smith@ > wrote:
      > >
      > > --- In ydn-javascript@ yahoogroups. com, "manne_swiss" <manne_swiss@ > wrote:
      > > >
      > > > Hi,
      > > > Is there any way in getting the metaFields attributes display in datatable? (i mean how to refer that attibute as key in the datatable)
      > > > thanks in advance!.
      > > >
      > >
      > > I don't understand the setup you're trying to achieve. Can you share some code as well as what output you are trying to receive?
      > >
      >

      You'll want to override your DataSource's doBeforeParseData method. In this method you'll have access to the full JSON object and can capture the needtoAccessthis property and iterate through the xyzArray items adding the additional property to each.

      Hope this helps,
      Luke



      From cricket scores to your friends. Try the Yahoo! India Homepage!
    Your message has been successfully submitted and would be delivered to recipients shortly.