1. #1
    Sencha User
    Join Date
    Feb 2013
    Location
    NZ
    Posts
    72
    Answers
    5
    Vote Rating
    0
    mazhar.shaikh is on a distinguished road

      0  

    Default Answered: grid cell tool tip issue.

    Answered: grid cell tool tip issue.


    Hi,

    On one column in my grid panel, I am using a renderer such as this:

    Code:
    metaData.tdAttr = 'data-qtip="' + value + '"';
    return value;
    To display the contents of the cell as a tooltip. I can see the tool tip alrightm But when data for the cell is
    3000030 "My Name" "Test Line 1 Test Line 2 Sydney | NSW Australia" 20/10/2012

    Tooltip only displays 3000030.

    My Json response looks like this.

    Code:
    "CustomerDetailString":"3000030 \"My Name\" \"Test Line 1 Test Line 2 Sydney | NSW Australia\" 20/10/2012"
    Can somebody tell me how I could get the entire string in the tooltip

    Thanks

  2. Try with this:

    Code:
    metaData.tdAttr = 'data-qtip="' + Ext.String.htmlEncode(value) + '"';
    If you need to enforce a specific tip width "data-qwidth" may also come in handy.

  3. #2
    Sencha - Support Team slemmon's Avatar
    Join Date
    Mar 2009
    Location
    Boise, ID
    Posts
    5,357
    Answers
    432
    Vote Rating
    200
    slemmon has much to be proud of slemmon has much to be proud of slemmon has much to be proud of slemmon has much to be proud of slemmon has much to be proud of slemmon has much to be proud of slemmon has much to be proud of slemmon has much to be proud of

      1  

    Default


    Try with this:

    Code:
    metaData.tdAttr = 'data-qtip="' + Ext.String.htmlEncode(value) + '"';
    If you need to enforce a specific tip width "data-qwidth" may also come in handy.

  4. #3
    Sencha User
    Join Date
    Feb 2013
    Location
    NZ
    Posts
    72
    Answers
    5
    Vote Rating
    0
    mazhar.shaikh is on a distinguished road

      0  

    Default


    Same question. But this time column is a Date column. ExtJS4.1.3 Doesnt have a render config that i could use.

  5. #4
    Sencha - Support Team slemmon's Avatar
    Join Date
    Mar 2009
    Location
    Boise, ID
    Posts
    5,357
    Answers
    432
    Vote Rating
    200
    slemmon has much to be proud of slemmon has much to be proud of slemmon has much to be proud of slemmon has much to be proud of slemmon has much to be proud of slemmon has much to be proud of slemmon has much to be proud of slemmon has much to be proud of

      0  

    Default


    You can extend dateColumn and override the template defaultRenderer in the case of dateColumn.

    http://docs.sencha.com/extjs/4.2.2/#...efaultRenderer
    Are you a Sencha products veteran who has wondered what it might be like to work at Sencha? If so, please reach out to our recruiting manager: sheryl@sencha.com

  6. #5
    Sencha User
    Join Date
    Feb 2013
    Location
    NZ
    Posts
    72
    Answers
    5
    Vote Rating
    0
    mazhar.shaikh is on a distinguished road

      0  

    Default


    Oops! that was a bit high level and outside the scope of my understanding
    Could you give an example.

    Thanks


    Quote Originally Posted by slemmon View Post
    You can extend dateColumn and override the template defaultRenderer in the case of dateColumn.

    http://docs.sencha.com/extjs/4.2.2/#...efaultRenderer

  7. #6
    Sencha - Support Team slemmon's Avatar
    Join Date
    Mar 2009
    Location
    Boise, ID
    Posts
    5,357
    Answers
    432
    Vote Rating
    200
    slemmon has much to be proud of slemmon has much to be proud of slemmon has much to be proud of slemmon has much to be proud of slemmon has much to be proud of slemmon has much to be proud of slemmon has much to be proud of slemmon has much to be proud of

      0  

    Default


    Sure. In this example we'll extend the Ext.grid.column.Date class to make our own using the code from the Ext.grid.column.Date class's defaultRender, but we'll also add our own little addition as well.

    When extending a class's methods you'll use the callParent() method to call the method of the parent class that we're extending so that its logic is executed (unless you don't want that, but in this case we do, because the parent class's defaultRenderer is what outputs the value in the date format so we'll want to keep that).

    Our override

    Are you a Sencha products veteran who has wondered what it might be like to work at Sencha? If so, please reach out to our recruiting manager: sheryl@sencha.com

  8. #7
    Sencha User
    Join Date
    Feb 2013
    Location
    NZ
    Posts
    72
    Answers
    5
    Vote Rating
    0
    mazhar.shaikh is on a distinguished road

      0  

    Default


    Well thats probably the answer that I am after. Appreciate the fiddle eg. I had never done a type extension before.

    Unfortunately, I am using sencha architect 2.1. And on the UI I have no option to replace the default xtype with my custom xtype 'mydatecolumn'. How would that be possible.

    If I publish my files on Architect without modifying the grid column xtype and then modify the same xtype using a text editor in my inetpub folder, I am able to see the tooltip. But I dont want to use that workaround.

    Thanks

    Quote Originally Posted by slemmon View Post
    Sure. In this example we'll extend the Ext.grid.column.Date class to make our own using the code from the Ext.grid.column.Date class's defaultRender, but we'll also add our own little addition as well.

    When extending a class's methods you'll use the callParent() method to call the method of the parent class that we're extending so that its logic is executed (unless you don't want that, but in this case we do, because the parent class's defaultRenderer is what outputs the value in the date format so we'll want to keep that).

    Our override


  9. #8
    Sencha User
    Join Date
    Feb 2013
    Location
    NZ
    Posts
    72
    Answers
    5
    Vote Rating
    0
    mazhar.shaikh is on a distinguished road

      0  

    Default


    I think Architect 2.2 has something called createAlias, that might be used for something similar (no sure)
    But I am using Architect 2.1

    Quote Originally Posted by mazhar.shaikh View Post
    Well thats probably the answer that I am after. Appreciate the fiddle eg. I had never done a type extension before.

    Unfortunately, I am using sencha architect 2.1. And on the UI I have no option to replace the default xtype with my custom xtype 'mydatecolumn'. How would that be possible.

    If I publish my files on Architect without modifying the grid column xtype and then modify the same xtype using a text editor in my inetpub folder, I am able to see the tooltip. But I dont want to use that workaround.

    Thanks

Thread Participants: 1

Tags for this Thread