Results 1 to 6 of 6

Thread: Clickable Grid with hyperlink

  1. #1
    Ext User
    Join Date
    Apr 2010
    Location
    Rome Italy
    Posts
    21

    Default Clickable Grid with hyperlink

    Hello everyone, I have been reading everywhere but could not find the right answer. I would like to put a grid of 4 columns i.e. ID, Organization Name, Employee Name and 'View Details'. THe View Details should be clickable or the whole row could be clickable. When the user click on the row or the 4 entry then the details of the Employee should be displayed on the same inde.php page.

    I could use the grid with clicks and have onClick function behind the row...I know that much but then can't figure out how run another sql to bring the Employee's details form the server and then display on the same page under the grid without reloading the page...

    I really need that urgent and any help would be very much appreciated.

    Thanks mill,

    Asad

  2. #2
    Sencha User
    Join Date
    May 2010
    Location
    Jakarta - Indonesia
    Posts
    169

    Default

    Hi Asadjan.., I have the same problem as you got.. I can't yet solve it.
    But based on your statement, you want to get record value in the selected grid. You can use rowActions plugin and copy() function to do that. it will get all record values in a grid you select and you can parse it into the next window.

    here is my snippet code :
    Code:
    'icon-copy2': function(grid,record,action,row,col)
                    {
                            var rec = record.copy(); // copy record
                            config.actionButtons.form.getForm().loadRecord(rec);
                    }
    Hope it will help you.

    In this case, I'm using rowActions to get all record values but I haven't been able to open new page.

  3. #3
    Ext User
    Join Date
    Apr 2010
    Location
    Rome Italy
    Posts
    21

    Default

    Hi Yagi,

    Thanks for your reply, Actually I don't want to open a new page but want to open a new Grid on the same page at the bottom and pull the data from Employee table after clicking on the row in the first grid where the employee Id is in the hyperlink.

    I hope to get some clear answer/help on this.

  4. #4
    Sencha User Condor's Avatar
    Join Date
    Mar 2007
    Location
    The Netherlands
    Posts
    24,245

    Default

    Does the grid store already contain all the information or do you need to make another request (the store can contain a lot more fields than are visible in the grid)?

    An additional request would require another .php page that returns extra data (in JSON, so NO HTML markup!) for a specific id. You can use this .php page to load your form from.

  5. #5
    Ext User
    Join Date
    Apr 2010
    Location
    Rome Italy
    Posts
    21

    Default

    Actually what I am trying to do is, when the grid is loaded successfully then I will click on a row or cell and then it will display another grid of the employees under the original grid on the same page, which has all the employees details and these details should be displayed in the normal html table like <table> <tr> stuff, because i have to use a lot of colspan and rowspan.

    I am thinking to call the php function and display for me the html part of it, I mean the html table with all the employee details. I don't know how to call the php from ExtJS????

    Any help would be very much appreciated

  6. #6
    Sencha User Condor's Avatar
    Join Date
    Mar 2007
    Location
    The Netherlands
    Posts
    24,245

    Default

    You could use:
    Code:
    panel.body.load({
      url: 'details.php',
      params: {
        id: idOfRecord
      }
    });
    ps. You could also load pure JSON and use an XTemplate to render the data (in that case your .php doesn't need to know anything about markup).

Similar Threads

  1. Newbie on Double clickable grid
    By sussol in forum Ext 3.x: Help & Discussion
    Replies: 2
    Last Post: 18 May 2010, 11:11 PM
  2. clickable image in grid cell
    By balusss in forum Ext 3.x: Help & Discussion
    Replies: 4
    Last Post: 25 Mar 2010, 10:15 PM
  3. How to make grid elements clickable?
    By businessman332211 in forum Ext 2.x: Help & Discussion
    Replies: 10
    Last Post: 3 Jul 2008, 10:07 AM

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
  •