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

How to display the metaFields attributes in datatable?

Expand Messages
  • manne_swiss
    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!.
    Message 1 of 6 , Sep 9 5:05 AM
      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!.
    • Satyam
      By definition, meta fields are not meant to be displayed, they are usually information about how the actual data fields are to be displayed. If you can point
      Message 2 of 6 , Sep 9 7:05 AM
        By definition, meta fields are not meant to be displayed, they are
        usually information about how the actual data fields are to be
        displayed. If you can point to them via the responseSchema.fields
        array, then they become regular fields and can be shown.

        Satyam

        manne_swiss escribió:
        > 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!.
        >
        >
        >
        > ------------------------------------
        >
        > Yahoo! Groups Links
        >
        >
        >
        > ------------------------------------------------------------------------
        >
        >
        > No virus found in this incoming message.
        > Checked by AVG - www.avg.com
        > Version: 8.5.409 / Virus Database: 270.13.86/2355 - Release Date: 09/08/09 20:45:00
        >
        >
      • y_lsmith
        ... 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?
        Message 3 of 6 , Sep 9 10:13 PM
          --- 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?
        • manne_swiss
          Sorry here is the sample code structure
          Message 4 of 6 , Sep 9 10:33 PM
            Sorry here is the sample code structure

            {"xyzResponse":{"xyzArray":[{"id":0,"name":"zyx",address:"sdseee"},{"id":1,"name":"aaaa",address:"ssdsdee"}]},"needtoAccessthis":"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?
            >
          • y_lsmith
            ... 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
            Message 5 of 6 , Sep 9 10:49 PM
              --- 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"}]},"needtoAccessthis":"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
            • nagaraj
              yay! it worked thanks Luke ... From: y_lsmith Subject: [ydn-javascript] Re: How to display the metaFields attributes in datatable?
              Message 6 of 6 , Sep 10 8:15 AM
                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.