1. #1
    Sencha User
    Join Date
    Jun 2013
    Posts
    5
    Vote Rating
    0
    CatGuy90 is on a distinguished road

      0  

    Default Trying to add computed column to Ext.grid.GridPanel

    Trying to add computed column to Ext.grid.GridPanel


    I am trying to add a computed column to a Ext.grid.GridPanel that has an Ext.data.JsonStore as its store and Ext.grid.Column columns that each has a dataIndex that uses one of the Ext.util.MixedCollection fields that belong to the Ext.data.JsonStore. The Ext.util.MixedCollection fields seem to be outputted as a result of a function that initializes a new Ext.data.Connection object that calls its "request" method to get the JSON encoded result of a MySQL query. I want the computed column to show the value of the result of a function that is more complex than that of the arithmetic addition of two columns as demonstrated in the following link:

    http://www.sencha.com/forum/showthre...culated-fields

    Specifically, I want to make this column depend on another MySQL query that needs the other fields that are in the Ext.grid.GridPanel. Is it possible to do this, and if so, does the link shown above have the key to doing what I want to do? Thank you. I am using Ext JS 3.4.0.

  2. #2
    Sencha User
    Join Date
    Jun 2013
    Posts
    5
    Vote Rating
    0
    CatGuy90 is on a distinguished road

      0  

    Default To add another example

    To add another example


    I am trying to do a similar thing to what is shown in the link below:

    http://www.sencha.com/forum/showthre...omputed-fields

    However, instead of doing an arithmetic multiplication of two fields, I want this thing to perform another MySQL query to calculate a result based on the values held in each row in the Ext.grid.GridPanel. Specifically, I want a query like "SELECT fieldname FROM tablename WHERE fieldname = 'value that the other column in the Ext.grid.GridPanel has' AND fieldname = 'value that the other column in the Ext.grid.GridPanel has' AND fieldname = 'value that the other column in the Ext.grid.GridPanel has'".

  3. #3
    Sencha User
    Join Date
    Jun 2013
    Posts
    5
    Vote Rating
    0
    CatGuy90 is on a distinguished road

      0  

    Default To really get a sense of what I am trying to do

    To really get a sense of what I am trying to do


    Please forget about my earlier posts in this thread. I think the following is a really good link that shows my situation:

    http://www.sencha.com/learn/ext-js-g...h-php-and-sql/

    Please refer to the section of the page above: "Creating our Search Form". To be as clear as I possibly can be, I am trying to add the computed column to an existing Ext.grid.GridPanel whose columns are already filled with results such as what the "searchPresidents()" function echoes. This computed column needs to see whether any field of each row in the grid has a duplicate value compared to the corresponding field of all other rows. What I want to do is add this column that somehow performs another MySQL query based on the results of what "searchPresidents()" echoes, hypothetically. The reason for this is that the existing columns of the Ext.grid.GridPanel should stay intact with the information that it already has (via "searchPresidents()"). The best representation of what I am trying to do is do is the following:

    Code:
    SELECT column1, column2, column3 FROM sometable t1 WHERE EXISTS (SELECT column1, column2, column3 FROM sometable t2 WHERE t2.column1 = t1.column1 OR t2.column2 = t1.column2 OR t2.column3 = "t1.column3");
    The "SELECT column1, column2, column3 FROM sometable t2" is already in the grid. The "SELECT column1, column2, column3 FROM sometable t1 WHERE EXISTS..." is the computed column that I am talking about.