Results 1 to 7 of 7

Thread: Grid Panel Listener - Retrieving Data from an Object

  1. #1

    Default 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 Attached Images

  2. #2
    Sencha User metalinspired's Avatar
    Join Date
    Apr 2012
    Posts
    98
    Answers
    4

    Default

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

  3. #3
    Sencha Premium User mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    40,448
    Answers
    3997

    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 @LikelyMitch

    Check out my GitHub:
    https://github.com/mitchellsimoens

    Posts are my own, not any current, past or future employer's.

  4. #4

    Default 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
    Answers
    4

    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

    Default Tooltip

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

  7. #7

    Default 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

Posting Permissions

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