Results 1 to 4 of 4

Thread: not able to access metaData.tdAttr in side gird column renderer in below case

  1. #1
    Sencha User
    Join Date
    Dec 2010
    Location
    Pasadena, CA
    Posts
    28
    Answers
    1

    Default not able to access metaData.tdAttr in side gird column renderer in below case

    Hey Guys,
    I am having issues in Grid column tooltip, when I am trying to set tooltip in an async call.
    Because, My requirement is in a grid loading, when i get DUE_COLOR from my rest call is red or '#FF0000'. I will do a rest call, and want to display value which comes back as tooltip. I tried below code. But, inside store.load callback it,s not able to access metaData.tdAttr of renderer, where as if i put out of store.load. It's able to understand, but, as it's async call, so, If i put my code metaData.tdAttr = 'data-qtip="' + str + '"' outside, it get get executed before store.load() method runs. So, I don't get desired result. If any body have any trick , Let me know.

    onDueRenderer: function(value, metaData, record, rowIndex, colIndex, store, view){
    if(record.get('DUE_COLOR')=='#FF0000'){//red
    var taskId = record.get('taskId');
    var str = '';
    Ext.getStore('TaskAlertLog').load({
    url:'rest/bpm/query/getTaskAlertLog',
    params:{
    'p_task_id':taskId
    },
    callback: function(records, operation, success) {
    // do something after the load finishes
    if(success==true){
    Ext.getStore('TaskAlertLog').each(function(record,id){
    str = str + '<tr><td>' + record.get('WHO') + '</td><td>' + record.get('WHEN') + '</td></tr>';
    });
    if (str.length > 0){
    str = '<table width=190>'+ str + '</table>';
    metaData.tdAttr = 'data-qtip="' + str + '"';
    }
    }
    }
    });
    return '<img src="' + flag + '" style="width:16px;height:16px;margin-right:4px;margin-top:-4px;margin-bottom:-4px;">' + '<b><span style="color:'+record.get('DUE_COLOR')+';'+'">'+ value + '</span></b>';
    }
    }


    Thanks
    Ranjay

  2. #2
    Sencha User joel.watson's Avatar
    Join Date
    Nov 2014
    Posts
    3,120
    Answers
    446

    Default

    Hi--

    The renderer isn't asynchronous, so trying to influence the metadata via the results of the Ajax call isn't going to work. You might reconsider if there is a way to include the data you are trying to query in the grid's store data. Not only will this provide a workaround for the issue you're encountering, but will also prevent all the extra Ajax requests as each renderer is executed.

    Thanks!
    Joel

  3. #3
    Sencha User
    Join Date
    Dec 2010
    Location
    Pasadena, CA
    Posts
    28
    Answers
    1

    Default

    Thanks Joel,
    I already did the solution what ever you are telling. I didn't see any response for 1-2 day. Then, I managed it from back-end. Data which i need to display on grid comes from database, from database itself passed a data in form of html content and set that data in the tooltip. This way it's much faster. At, that time, we wanted to keep 2 separate rest call, but, now it's working fine.
    Thanks
    Ranjay

  4. #4
    Sencha User joel.watson's Avatar
    Join Date
    Nov 2014
    Posts
    3,120
    Answers
    446

    Default

    Cool, glad to hear you have a solution.

    Thanks!
    Joel

Similar Threads

  1. Replies: 1
    Last Post: 7 Aug 2015, 2:45 PM
  2. Replies: 2
    Last Post: 12 Jun 2015, 8:56 AM
  3. Replies: 1
    Last Post: 9 Feb 2013, 1:24 PM
  4. [CLOSED] Grid Cell Renderer (metaData.tdAttr issue)
    By ext_grischa in forum Ext:Bugs
    Replies: 4
    Last Post: 4 Jan 2013, 2:50 AM
  5. Gird row and column in renderer function
    By v.madhu in forum Ext 3.x: Help & Discussion
    Replies: 9
    Last Post: 15 Jan 2010, 4:34 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •