Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    listgrid with hyperlinked field

    I'd like a column in my listgrid to show data (numbers) that appear hyperlinked (eg blue, underlined). When a user clicks on it, I need to be able to trap this "click" event and do something with it. I will usually have only about 1000 rows of data, but on rare circumstances, I may have 10,000 or even 100,000 rows of data.

    My solution is to use the "clickhandler" for listgrid cells combined with a cellFormater in which I will prefix the value string with the html codes for making the text blue and underlined. I could alternatively use SmartGWT HILITES.

    Is this the best approach? I intuitively feel that there might be a better perfomant way to define a cell's formatting for the whole column without having to invoke the cellformatter logic for each and every data value. That said, it may not be that big of a performance penalty for 1000 rows or even 100,000 rows. Any advice would be appreciated.

    ================

    Additional details:
    ======================
    SmartGWT (not smartclient) Version: SmartClient Version: v8.3p_2012-11-26/PowerEdition Deployment (built 2012-11-26)
    ...
    Browser: Mozilla Firefox ESR 10.0.7
    GWT SDK: 2.5.0rc2
    Sun JDK 1.6.0_13
    OS: Centos 6.x
    IDE: MyEclipse 10.6 with Google Plugin for Eclipse (3.1.0)

    #2
    There's a built-in ListGridFieldType "link" that might be able to handle this for you. However, if there's some nuance of how the links appear that you want to be different, doing this via a CellFormatter is fine, and shouldn't have a noticeable performance impact over fieldType:"link".

    Note that even with 100,000 rows, your formatter is only going to be invoked for rows visible in the viewport (and a small predrawn area controlled by drawAheadRatio).

    Comment


      #3
      I already started using "clickhandler" for the whole listgrid. That said, if I were to use the "listgridfieldtype" of "link", how do I interecept the "link" to run a smartgwt piece of code instead of opening up a new url-based window.

      Comment


        #4
        Take a look at the docs for ListGridFieldType "link" - all your different options are described right there.

        Comment

        Working...
        X