[CLOSED] How do I get the ID value (Primary Key) of a Datasource using gridPanel

  1. #1

    [CLOSED] How do I get the ID value (Primary Key) of a Datasource using gridPanel

    Excuse my ignorance my friends, but i'm a totally novice using gridpanel of coolite and I don't know how to get the primary key of the datasource. Is there a property to be set to the store or in the grid panel?, How do i get the primary key, or even more, how do i get the value of a field?

    Once more, excuse my ignorance and please help me.

    thanks, afhi
  2. #2

    RE: [CLOSED] How do I get the ID value (Primary Key) of a Datasource using gridPanel

    Hi,

    The Reader of Store has ReaderID property which should points to ID field.

    On client side (in javascript) you can get row using

    Store1.getById('MyID')
    May be you post some code and describe problems.
    Last edited by geoffrey.mcgill; Feb 22, 2011 at 3:17 AM.
  3. #3

    RE: [CLOSED] How do I get the ID value (Primary Key) of a Datasource using gridPanel

    Hi vladimir, thanks for giving me the answer that fast. I'm using ReaderId Property to get the Id field just like you said ... i'm getting it, but now my page seems to be doing an infinite postback so my store refreshes infinitely. To make this i guided myself using the "One to Many" example shown at examples.ext.net because that example is almost the same i want to do but with checkselection. I don't include the code because it is a little big.

    What i'm trying to do (acomplished) is to view data on the gridpanel3, depending of what row was selected through the checkselection in gridpanel1 and gridpanel2 . Once a row is selected the store of the gridpanel3 is reloaded using store3.reload through a listener defined inside the checkselectionmodel of each gridpanel (1 and 2). It's woking great, but as i said before my page seems to be doing an infinite postback so my store3 refreshes infinitely. Maybe you could tell me what i'm doing wrong.
    Last edited by geoffrey.mcgill; Feb 22, 2011 at 3:18 AM.
  4. #4

    RE: [CLOSED] How do I get the ID value (Primary Key) of a Datasource using gridPanel

    Hi,

    Please, check that your Stores connected to first and second grid don't DataBind during AjaxEvent. Do DataBind only when need.

    You can check that current request is AjaxEvent
       if(!Ext.IsAjaxRequest)
       {
           Store1.DataBind();
       }

  5. #5

    RE: [CLOSED] How do I get the ID value (Primary Key) of a Datasource using gridPanel

    Hi, Vladsch thanks so much for your answer once again.
    That was it, i needed to verify if it was an ajaxevent before doing the databind.

    thanks pal.

    -afhi-

Similar Threads

  1. Replies: 2
    Last Post: Apr 11, 2012, 11:10 AM
  2. Replies: 5
    Last Post: Feb 01, 2012, 11:54 AM
  3. GridPanel.Store.Primary is always Null !!!
    By Mohammad in forum 1.x Help
    Replies: 6
    Last Post: Dec 13, 2011, 5:37 AM
  4. [CLOSED] Store and 3 Primary Key
    By pdcase in forum 1.x Legacy Premium Help
    Replies: 1
    Last Post: Nov 23, 2010, 11:21 AM
  5. [CLOSED] Gridview Primary Key
    By GmServizi in forum 1.x Legacy Premium Help
    Replies: 7
    Last Post: Aug 08, 2009, 10:08 AM

Posting Permissions