TableGrid selector

  1. #1

    TableGrid selector

    As far as I know, the Ext:TableGrid selects its target table by id only.

    I would like to propose a new feature allowing to select tables by css class or any other selector alowed in Ext.select().

    This would allow to convert multiple tables in one operation, even all tables in one page. For instance, I could add this control to the master page.

    Could it be done?

    Thank you in advance
  2. #2
    Hi,

    Please clarify do you want to use single <ext:TableGrid> for multiple tables? If so, no, this control applies only one table.

    Regarding to the css selector.

    Internally Ext.get(Mixed el) method is used to retrieve table element. In accordind to ExtJS docs:
    http://dev.sencha.com/deploy/dev/docs/?class=Ext&member=get

    it can apply
    The id of the node, a DOM Node or an existing Element.
    So, it doesn't apply css selector and return only one element.

    But you should be able to use Ext.select() to retrieve table elements and pass these elements to <ext:TableGrid> controls as Table property.
  3. #3

    Clarification

    Proposed syntax could be something like

    <ext:TableGrid runat="server" Table=".cssclass" StripeRows="true" />
    or even better

    <ext:TableGrid runat="server" Selector="#containerDiv .targetTableClass" StripeRows="true" />

    I understand that it could be necessary to change tablegrid.js to use
    table = Ext.select(config.selector); //instead of Ext.get(config.table)
    and then loop results.


    Anyway, if you think this feature should not be part of Ext.net a workaroud will be welcome. In my scenario, i need to unify look and feel for tables redered dinamically using a third party component, so it is imposible to determine their Id.

    Thank you
  4. #4
    Hi,

    I think at this point the best we could do is add as an official Feature Request for future review and/or implementation.
    Geoffrey McGill
    Founder & CEO
  5. #5
  6. #6
    Hi,

    You can easly to do it via javascript code
    Ext.select("#containerDiv .targetTableClass", true).each(function(item){
          Ext.grid.TableGrid({
                    stripeRows:true,
                    table: item
          });
    });
    Vladimir Shcheglov
    Sr. Developer

Similar Threads

  1. selector by generated id
    By WISEMAN in forum 1.x Help
    Replies: 1
    Last Post: Mar 23, 2012, 2:19 PM
  2. [CLOSED] #{} Selector - What is it?
    By jwf in forum 1.x Premium Help
    Replies: 2
    Last Post: Sep 07, 2011, 9:27 PM
  3. [CLOSED] [1.1] TableGrid
    By Timothy in forum 1.x Premium Help
    Replies: 1
    Last Post: Jul 21, 2011, 5:19 PM
  4. [CLOSED] What is Ext:TableGrid?
    By jchau in forum 1.x Premium Help
    Replies: 3
    Last Post: Jan 26, 2011, 6:31 PM
  5. Example of tablegrid for version 0.8?
    By lucas in forum 1.x Help
    Replies: 10
    Last Post: Jan 18, 2011, 6:53 PM

Tags for this Thread

Posting Permissions