4 Replies Latest reply on Mar 1, 2009 11:02 AM by Newsgroup_User

    Datagrid Links

    funnyduddy
      Hi,

      I've got a datagrid of data which looks like this:

      Name --- Price --- Url
      B1 --- 16.99 ---- http://www.domain.com/hhfddf.html
      B2 --- 16.99 ---- http://www.domain.com/2hhfddf.html
      B3 --- 18.99 ---- http://www.domain.com/2hhfddf.html

      What I want to do is make the Url clickable which I've done via a linkbutton but instead of every row have the http://www.domain.com/ in the datafile as it will always be the same, I would like to define the starting address in a function or something so the XML file will be like this

      Name --- Price --- Url
      B1 --- 16.99 ---- hhfddf.html
      B2 --- 16.99 ---- 2hhfddf.html
      B3 --- 18.99 ---- 2hhfddf.html

      Therefore loading the XML file will be a lot faster due to the same url being in a function or something.

      Can anyone help as I'm at my wits end

      Thanks
        • 1. Re: Datagrid Links
          funnyduddy Level 1
          Anyone?

          THanks
          • 2. Re: Datagrid Links
            Level 7

            "funnyduddy" <webforumsuser@macromedia.com> wrote in message
            news:go95n0$21o$1@forums.macromedia.com...
            > Hi,
            >
            > I've got a datagrid of data which looks like this:
            >
            > Name --- Price --- Url
            > B1 --- 16.99 ---- http://www.domain.com/hhfddf.html
            > B2 --- 16.99 ---- http://www.domain.com/2hhfddf.html
            > B3 --- 18.99 ---- http://www.domain.com/2hhfddf.html
            >
            > What I want to do is make the Url clickable which I've done via a
            > linkbutton
            > but instead of every row have the http://www.domain.com/ in the datafile
            > as it
            > will always be the same, I would like to define the starting address in a
            > function or something so the XML file will be like this
            >
            > Name --- Price --- Url
            > B1 --- 16.99 ---- hhfddf.html
            > B2 --- 16.99 ---- 2hhfddf.html
            > B3 --- 18.99 ---- 2hhfddf.html
            >
            > Therefore loading the XML file will be a lot faster due to the same url
            > being
            > in a function or something.
            >
            > Can anyone help as I'm at my wits end


            Unless you have at least several hundred records, including the full url
            shouldn't make much difference to loading time. If you do have that many
            records, you should be using amf. But the answer is to just concatenate
            things together in the labelFunction.


            • 3. Re: Datagrid Links
              funnyduddy Level 1
              Hi I have several 100 records yes but how do I use AMF how would I concatenate them too?

              Thankls
              • 4. Re: Datagrid Links
                Level 7

                "funnyduddy" <webforumsuser@macromedia.com> wrote in message
                news:goei3s$mea$1@forums.macromedia.com...
                > Hi I have several 100 records yes but how do I use AMF how would I
                > concatenate them too?

                You'd take whatever property of the object you got back from the service and
                concat it to your base url.

                yourLabelFunction(item:yourRemoteClass, column:DataGridColumn):String {
                return baseUrl + item.someProperty;
                }