[CLOSED] Colouring rows in a gridpanel in a Partial View Result

  1. #1

    [CLOSED] Colouring rows in a gridpanel in a Partial View Result

    Dear Ext.Net,

    I am using a gridpanel in a Partial View Result,

    I want to call a javascript function when each row is rendered, passing the script the record EG applyClass(record),

    such that i can apply a class based on values of the record.

    I saw mention of the GetRowClass property of the gridview which is set to a javascript function,

    but it is not evident how to set the grid view for a grid panel and call the GetRowclass property in razor.
    Last edited by Baidaly; Mar 20, 2013 at 2:42 AM. Reason: [CLOSED]
  2. #2
    Hello!

    Please, read the following thread: http://forums.ext.net/showthread.php?23242
  3. #3
    Do you have example for the Razor view?

    Thanks,
  4. #4
    We don't have an example for GetAdditionalData, but markup should be following:

    @(Html.X().GridPanel()
    	.Features(Html.X().RowBody()
    		.GetAdditionalData("orig.itemCls='testCls'; orig.itemClasses.push('testCls');")
    	)
    )
  5. #5
    Last edited by Daniil; Mar 20, 2013 at 5:45 AM. Reason: Please use [CODE] tags
  6. #6
    If you need apply row css class is depended from a record then you can easly use GetRowClass like in the following sample
    https://examples2.ext.net/#/GridPane...rking_Records/

    Razor syntax looks like
    Html.X().GridPanel()
                    .View(
                        Html.X().GridView()
                            .GetRowClass(fn=> fn.Fn="getRowClass")
                    )
  7. #7
    It works, thank you!
  8. #8
    Hi @gets_gui,

    Please do not forget to wrap the code in [CODE] tags.

Similar Threads

  1. [MVC] How to use a partial view in a window?
    By KBorkiewicz in forum 2.x Help
    Replies: 7
    Last Post: Nov 21, 2012, 11:11 PM
  2. [CLOSED] [2.1] MVC Partial View
    By softmachine2011 in forum 2.x Legacy Premium Help
    Replies: 4
    Last Post: Aug 23, 2012, 12:04 PM
  3. Replies: 8
    Last Post: Jul 16, 2012, 10:57 PM
  4. [CLOSED] Partial View Error
    By peter.campbell in forum 1.x Legacy Premium Help
    Replies: 1
    Last Post: Feb 10, 2012, 10:32 AM
  5. [CLOSED] RegisterOnReadyScript in MVC partial view
    By SandorD in forum 1.x Legacy Premium Help
    Replies: 22
    Last Post: Aug 10, 2011, 4:17 PM

Posting Permissions