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

Datatable: sorted column background

Expand Messages
  • bellavite
    Hi all :) I m working with the example for the server-side pagination with the history manager:
    Message 1 of 5 , Jun 2, 2008
    View Source
    • 0 Attachment
      Hi all :)

      I'm working with the example for the server-side pagination with the history manager:
      http://developer.yahoo.com/yui/examples/datatable/dt_server_pag_sort.html

      as you can see, sorted columns do not have the correct light-blue background, like they
      have in this example:
      http://developer.yahoo.com/yui/examples/datatable/dt_clientsorting.html

      I don't understand why: what is wrong in the first code?

      Best Regards

      Giampaolo
    • y_lsmith
      Giampaolo, Thanks for noticing that! The code references to asc and desc should be yui-dt-asc and yui-dt-desc respectively. I ll make a note to update
      Message 2 of 5 , Jun 2, 2008
      View Source
      • 0 Attachment
        Giampaolo,

        Thanks for noticing that! The code references to "asc" and "desc"
        should be "yui-dt-asc" and "yui-dt-desc" respectively.

        I'll make a note to update the example.

        Luke


        --- In ydn-javascript@yahoogroups.com, "bellavite" <bellavite@...> wrote:
        >
        > Hi all :)
        >
        > I'm working with the example for the server-side pagination with the
        history manager:
        >
        http://developer.yahoo.com/yui/examples/datatable/dt_server_pag_sort.html
        >
        > as you can see, sorted columns do not have the correct light-blue
        background, like they
        > have in this example:
        > http://developer.yahoo.com/yui/examples/datatable/dt_clientsorting.html
        >
        > I don't understand why: what is wrong in the first code?
        >
        > Best Regards
        >
        > Giampaolo
        >
      • bellavite
        ... well ok thanks...! But I m getting a crazy searching where should I replace that values :( I would like the connection manager sends only asc and desc
        Message 3 of 5 , Jun 2, 2008
        View Source
        • 0 Attachment
          --- In ydn-javascript@yahoogroups.com, "y_lsmith" <lsmith@...> wrote:
          >
          > Giampaolo,
          >
          > Thanks for noticing that! The code references to "asc" and "desc"
          > should be "yui-dt-asc" and "yui-dt-desc" respectively.

          well ok thanks...! But I'm getting a crazy searching where should I replace that values :(
          I would like the connection manager sends only 'asc' and 'desc' and not the whole class
          name, since i'm using a server side script reacting to asc and desc.

          Any hint?

          Best regards

          Giampaolo
        • y_lsmith
          ... replace that values :( ... not the whole class ... In the handlePagination function, change sortedBy.dir to sortedBy.dir.replace( yui-dt- , ) In the
          Message 4 of 5 , Jun 2, 2008
          View Source
          • 0 Attachment
            --- In ydn-javascript@yahoogroups.com, "bellavite" <bellavite@...> wrote:
            >
            > --- In ydn-javascript@yahoogroups.com, "y_lsmith" <lsmith@> wrote:
            > >
            > > Giampaolo,
            > >
            > > Thanks for noticing that! The code references to "asc" and "desc"
            > > should be "yui-dt-asc" and "yui-dt-desc" respectively.
            >
            > well ok thanks...! But I'm getting a crazy searching where should I
            replace that values :(
            > I would like the connection manager sends only 'asc' and 'desc' and
            not the whole class
            > name, since i'm using a server side script reacting to asc and desc.
            >
            > Any hint?
            >
            > Best regards
            >
            > Giampaolo
            >

            In the handlePagination function, change
            sortedBy.dir
            to
            sortedBy.dir.replace('yui-dt-','')

            In the handleSorting function change
            sDir = (this.get("sortedBy").dir === "asc") ?
            to
            sDir = (this.get("sortedBy").dir.indexOf("yui-dt-") !== -1) ?

            After myDataSource is constructed, add
            myDataSource.subscribe('responseParseEvent', function (args) {
            var meta = args.response.meta;
            if (meta && meta.sortDir) {
            if (meta.sortDir.indexOf("yui-dt-") !== 0) {
            meta.sortDir = "yui-dt-" + meta.sortDir;
            }
            }
            });

            Hope this helps,
            Luke
          • bellavite
            Hi Luke, yay! 8) it s working right now :) Thank you very much! Giampaolo
            Message 5 of 5 , Jun 2, 2008
            View Source
            • 0 Attachment
              Hi Luke,

              yay! 8) it's working right now :) Thank you very much!

              Giampaolo

              --- In ydn-javascript@yahoogroups.com, "y_lsmith" <lsmith@...> wrote:
              >
              > --- In ydn-javascript@yahoogroups.com, "bellavite" <bellavite@> wrote:
              > >
              > > --- In ydn-javascript@yahoogroups.com, "y_lsmith" <lsmith@> wrote:
              > > >
              > > > Giampaolo,
              > > >
              > > > Thanks for noticing that! The code references to "asc" and "desc"
              > > > should be "yui-dt-asc" and "yui-dt-desc" respectively.
              > >
              > > well ok thanks...! But I'm getting a crazy searching where should I
              > replace that values :(
              > > I would like the connection manager sends only 'asc' and 'desc' and
              > not the whole class
              > > name, since i'm using a server side script reacting to asc and desc.
              > >
              > > Any hint?
              > >
              > > Best regards
              > >
              > > Giampaolo
              > >
              >
              > In the handlePagination function, change
              > sortedBy.dir
              > to
              > sortedBy.dir.replace('yui-dt-','')
              >
              > In the handleSorting function change
              > sDir = (this.get("sortedBy").dir === "asc") ?
              > to
              > sDir = (this.get("sortedBy").dir.indexOf("yui-dt-") !== -1) ?
              >
              > After myDataSource is constructed, add
              > myDataSource.subscribe('responseParseEvent', function (args) {
              > var meta = args.response.meta;
              > if (meta && meta.sortDir) {
              > if (meta.sortDir.indexOf("yui-dt-") !== 0) {
              > meta.sortDir = "yui-dt-" + meta.sortDir;
              > }
              > }
              > });
              >
              > Hope this helps,
              > Luke
              >
            Your message has been successfully submitted and would be delivered to recipients shortly.