GetRowClass in Ext 7.1

  1. #1

    GetRowClass in Ext 7.1

    Please help how to add below code in My .Net core project. I have tried but, Doesn't look like it is available, I couldn't find an example. Is there any way I can find some kind of document that I can refer to since latest version doesn't have enough examples to find the syntaxes what we needed for development.
    <View>
                        <ext:GridView ID="gridView2" runat="server">
                            <GetRowClass Fn="getRowClass" />
                            
                        </ext:GridView>
                    </View>
    I have tried like below example
    <ext-gridPanel
                    title="GridPanel"
                    width="960"
                    height="640"
                    frame="true">
                    <store>
                        <ext-store data="Model.GridData">
                            <fields>
                                <ext-dataField name="company" />
                                <ext-numberDataField name="price" />
                                <ext-numberDataField name="change" />
                                <ext-numberDataField name="pctChange" />
                                <ext-dateDataField name="lastChange" dateFormat="yyyy-MM-dd hh:mm:tt" />
                            </fields>
                        </ext-store>
                    </store>
                    <columns>
                        <ext-column text="Company" dataIndex="company" flex="1" />
                        <ext-column text="Price" dataIndex="price" renderer="Ext.util.Format.usMoney" />
                        <ext-column text="Change" dataIndex="change" renderer="change" />
                        <ext-column text="Change %" dataIndex="pctChange" renderer="pctChange" />
                        <ext-dateColumn text="Last Updated" dataIndex="lastChange" width="150" format="yyyy-MM-dd" />
                    </columns>
                    <View>
                        <ext-GridView >
                            <GetRowClass Fn="getRowClass" />
                            
                        <ext-GridView>
                    </View>
                </ext-gridPanel>
  2. #2
    Hello, @Fahd!

    Some syntax sugar from Ext.NET 5 didn't make it to version 7, which is the case of the GetRowClass one.

    But given the snippets you provided, I believe it would suffice to just add x:raw-getRowClass="getRowClass", in your case, to the view definition. The view handle also changed from ext:GridView into ext-TableView to resemble more its current name in Ext JS framework.

    Thus, I believe this pattern should do for you:

    <viewConfig>
        <ext-tableView x:raw-getRowClass="getRowClass" />
    </viewConfig>
    Quote Originally Posted by Fahd
    I have tried but, Doesn't look like it is available, I couldn't find an example.
    One example that shows how to pass custom view configs is the Grid Panel > Editable > Editor With DirectMethod one.

    Quote Originally Posted by Fahd
    Is there any way I can find some kind of document that I can refer to since latest version doesn't have enough examples to find the syntaxes what we needed for development.
    We didn't have the chance to compile a comprehensive documentation, focused to Razor Pages and MVC's Razor syntax, but spent efforts to make IntelliSense intuitive enough to help figure out similar code (when it changes) from the previous versions of Ext.NET.

    Ext.NET 7 is updated to match the current Ext JS API, so hierarchy of components, settings and names should be more congruent now. Previous (5.x-) versions kept legacy Ext JS syntax from as early as 3.x Ext JS versions for backwards compatibility and avoid breaking changes whenever possible.

    Ext.NET 7 is a rewrite from scratch based on said current API linked above. One good example is exactly the Ext.grid.GridView handle (<ext:GridView />); it was like that in early Ext.NET versions, matching the current state of Ext JS (version 3.4 back then) and, at some point, was renamed to Ext.view.Table and this was never reflected to 5.x-.

    So when you miss a component in Ext.NET 7, chances are you're going to find its "new" handle in Ext JS documentation (linked above).

    Hope this helps!
    Fabrício Murta
    Developer & Support Expert

Similar Threads

  1. [CLOSED] GetRowClass MVC
    By aguidali in forum 2.x Legacy Premium Help
    Replies: 2
    Last Post: Sep 12, 2014, 6:19 AM
  2. getRowClass - documentation
    By matthew in forum 2.x Help
    Replies: 4
    Last Post: Jul 15, 2013, 12:55 PM
  3. Set GetRowClass in code behind
    By Rupesh in forum 1.x Help
    Replies: 1
    Last Post: Apr 17, 2012, 4:38 PM
  4. rowIndex in GetRowClass - possible?
    By Tbaseflug in forum 1.x Help
    Replies: 2
    Last Post: Sep 23, 2009, 10:25 PM
  5. GridPanel GetRowClass
    By louis in forum 1.x Help
    Replies: 4
    Last Post: Mar 04, 2009, 11:15 AM

Posting Permissions