1. #1
    Sencha User
    Join Date
    Sep 2012
    Posts
    8
    Vote Rating
    0
    oneofakind007 is on a distinguished road

      0  

    Default Unanswered: Grid Panel Listener - Retrieving Data from an Object

    Unanswered: Grid Panel Listener - Retrieving Data from an Object


    Hey Community,

    Guys, I'm quite new to extJS and I would like your help.
    I have this Grid.Panel with listeners, I don't know if i got it right. Anyway, I got it to print out its properties but I cant get the data. Here is what the console printed out.

    Object { internalId=, raw={...}, data={...}, more...}

    after clicking it:

    Capture.PNG

    The "data" encircled in red. How do get those information?
    Attached Images

  2. #2
    Sencha User metalinspired's Avatar
    Join Date
    Apr 2012
    Posts
    98
    Vote Rating
    4
    Answers
    4
    metalinspired is on a distinguished road

      1  

    Default


    Can you post some code?
    Image you attached shows a model instance whose data you can get with get() function.

  3. #3
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    St. Louis, MO
    Posts
    33,641
    Vote Rating
    434
    Answers
    3107
    mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of

      0  

    Default


    Yeah, so to get the name property in the data object, you can do:

    Code:
    record.get('name')
    and it will return 'Barney Stinson' from what the image shows
    Mitchell Simoens @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    http://www.JSONPLint.com - Source to lint your JSONP!

    Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
    https://github.com/mitchellsimoens

    Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/

    Need more help with your app? Hire Sencha Services services@sencha.com

    Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is almost in print!

    When posting code, please use BBCode's CODE tags.

  4. #4
    Sencha User
    Join Date
    Apr 2013
    Posts
    7
    Vote Rating
    0
    mohammadamir is on a distinguished road

      0  

    Default Tooltip

    Tooltip


    I nm not understand what happen is going on.

    dockedItems: [{
    xtype: 'toolbar',
    dock: 'top',
    items:[{
    text: '<img src="../static/images/refresh.gif" title="xyz">',
    enableToggle: true,
    iconCls: 'refresh', //nice refresh icon
    listeners: {
    toggle: function (button, pressed) {
    var grid = button.up('grid');
    if (!Ext.isDefined(grid.refreshTask)) { //check if the task is already created
    grid.refreshTask = runner.newTask({ //create task
    run: function () { getdata(); },
    interval: 30000
    });
    }
    if (pressed) { //toggle between start and stop
    grid.refreshTask.start();
    } else {
    grid.refreshTask.stop();
    }
    }
    }
    }]


    I want to add tooltip on image its done but iconCls: 'refresh', take some spece after image image show when I remove " iconCls: 'refresh', " its not show tooltip text.

  5. #5
    Sencha User metalinspired's Avatar
    Join Date
    Apr 2012
    Posts
    98
    Vote Rating
    4
    Answers
    4
    metalinspired is on a distinguished road

      1  

    Default


    don't use text property to define icon.
    you should define icon as background-image in CSS class that you add in iconCls.
    to add tooltip simply add tooltip property to the button you're creating and call Ext.tip.QuickTipManager.init(); when initializing your application to enable tooltips

  6. #6
    Sencha User
    Join Date
    Apr 2013
    Posts
    7
    Vote Rating
    0
    mohammadamir is on a distinguished road

      0  

    Default Tooltip

    Tooltip


    Thanks metalinsepride
    I was missing to add Ext.tip.QuickTipManager.init();

  7. #7
    Sencha User
    Join Date
    Apr 2013
    Posts
    7
    Vote Rating
    0
    mohammadamir is on a distinguished road

      0  

    Default Tooltip dynamic

    Tooltip dynamic


    Now I want to use tooltip dynamic when button is pressed tooltip = start when button unpressed tooltip = stop.
    What I will have to add ?

Tags for this Thread