[CLOSED] How to GetRowClass will work in v2.x

  1. #1

    [CLOSED] How to GetRowClass will work in v2.x

    Hi I am using GetRowClass to change the colors of row on date bases in v1.1 but this not work in v2.x
    How could GetRowClass function will work in v2.x
    <style type="text/css">
        .red
        {
            background: red;
        }
        .green
        {
            background: green;
        }
        .yellow
        {
            background: yellow;
        }
        .x-label
        {
            margin-top: 3px;
            float: left;
        }
    </style>
    <script type="text/javascript">
        function getRowClass(record) {
            var currentDateTime = new Date();
            if (record.data.ExpectedDate != null) {
                if (record.data.ExpectedDate < currentDateTime) {
                    return 'green';
                }
            }
            if (record.data.Reminder != null) {
                if (record.data.Reminder < currentDateTime) {
                    return 'yellow';
                }
            }
            if (record.data.DeadLine != null) {
                if (record.data.DeadLine < currentDateTime) {
                    return 'red';
                }
            }
        }
    </script>
    <ext:Viewport ID="RequestActiviesGridViewPort" runat="server" Layout="Fit">
        <Items>
            <ext:Panel ID="PanelContent" runat="server" Layout="FitLayout" Region="Center">
                <Items>
                    <ext:GridPanel ID="GridPanel_Requests" runat="server" IDMode="Explicit" FireSelectOnLoad="true">
                        <View>
                            <ext:GroupingView>
                                <GetRowClass Fn="getRowClass" />
                            </ext:GroupingView>
                        </View>
                    </ext:GridPanel>
                </Items>
            </ext:Panel>
        </Items>
    </ext:Viewport>
    Thanks
    Last edited by Daniil; Feb 12, 2014 at 12:02 PM. Reason: [CLOSED]
  2. #2
  3. #3
    Quote Originally Posted by Vladimir View Post

    Now getRowClass function working without any bug/issue but the color of row does not change
    <script type="text/javascript">
        function getRowClass(record) {
            console.log(record);
            var currentDateTime = new Date();
            if (record.ExpectedDate != null) {
                if (record.ExpectedDate < currentDateTime) {
                    
                    return 'green';
                }
            }
            if (record.Reminder != null) {
                if (record.Reminder < currentDateTime) {
                    return 'yellow';
                }
            }
            if (record.DeadLine != null) {
                if (record.DeadLine < currentDateTime) {
                    return 'red';
                }
            }
        }
    </script>
  4. #4
    Please inspect the HTML elements and its CSS rules to determine whatever your CSS rules is not applied at all or overridden by something.

    This helps to understand what I mean by inspecting HTML elements and its CSS rules.
    CSS Change TabPanel Header Color - Ext.NET on Vimeo
  5. #5
    Quote Originally Posted by Daniil View Post
    Please inspect the HTML elements and its CSS rules to determine whatever your CSS rules is not applied at all or overridden by something.

    This helps to understand what I mean by inspecting HTML elements and its CSS rules.
    CSS Change TabPanel Header Color - Ext.NET on Vimeo

    Thanks

    Please close that thread

Similar Threads

  1. getRowClass - documentation
    By matthew in forum 2.x Help
    Replies: 4
    Last Post: Jul 15, 2013, 12:55 PM
  2. Set GetRowClass in code behind
    By Rupesh in forum 1.x Help
    Replies: 1
    Last Post: Apr 17, 2012, 4:38 PM
  3. [CLOSED] [1.0] Does GetRowClass still work the same in 1.0?
    By SFritsche in forum 1.x Legacy Premium Help
    Replies: 2
    Last Post: Jan 05, 2010, 1:14 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