[CLOSED] Server side custom GridPanel Column rendering

  1. #1

    [CLOSED] Server side custom GridPanel Column rendering

    Hi.
    I need a GridPanel showing an icon depending on some data criteria.

    I see many posts with examples calling a client side function from a Renderer.

    http://forums.ext.net/showthread.php?13336

    I would prefer to have this logic server side so I don't expose it to the client.

    Is it possible for a Renderer to call a server side function?

    Thanks
    Regards
    Fernando
    Last edited by Daniil; Feb 24, 2012 at 3:06 PM. Reason: [CLOSED]
  2. #2
    Hi,

    Here is the answer:
    http://forums.ext.net/showthread.php...ll=1#post71828

    I should also clarify that:

    1. A Column Renderer function is called for each Column cell.
    2. Many operations cause a GridPanel and its rows to be re-rendered - loading, paging, sorting, filtering a Store data, editing a cell => a Renderer function will be called again for each re-rendered cell.
    3. So, if even it would be supported, it's easy to imagine how it would be slow - a server request for each cell. Generally, it would be an unused feature.

    As the result of the above - all required data that you would like to use within a Renderer function should be on client side. For example, you could bind it to a Store using an additional RecordField (-s).
  3. #3
    Thanks Daniil

    I see the workaround with DirectMethods. I didn't imagine this scenario and agree that would not be performant at all (meaning unuseful)

    I am not thinking EXT's way since I used to have my own controls before EXT.Net and my custom Grid refreshed complete from server side bringing the whole HTML from an Ajax function in the code behind. That way I used to add a custom column server side that calculated the cell content each time.

    With Ext rendering and refreshing schema I believe the only way I could set the custom column logic server side is manipulating the Datasource before databinding.

    Just thinking, OnRefresh method of the Store would add a column to the DataTable of the type String and calculate there the cell content for each row. Then add the binding information on the ColumnModel to that new ad-hoc column.

    If Databinding from Entities Collection, an ad-hoc property could be added to that type (anyway, I would not tarnish business model with presentation issues)

    I know this is not a pretty clean solution, but it is the only way I imagine achieving this.

    Do you see any better solution?

    Regards
    Fernando
  4. #4
    Quote Originally Posted by FAS View Post
    With Ext rendering and refreshing schema I believe the only way I could set the custom column logic server side is manipulating the Datasource before databinding.
    Generally, yes.

    Quote Originally Posted by FAS View Post
    Just thinking, OnRefresh method of the Store would add a column to the DataTable of the type String and calculate there the cell content for each row. Then add the binding information on the ColumnModel to that new ad-hoc column.
    Just to clarify - no way to bind just a Column data, you will need to bind all data.

    Quote Originally Posted by FAS View Post
    I know this is not a pretty clean solution, but it is the only way I imagine achieving this.

    Do you see any better solution?
    I can't see any criminal to add an additional column to the DataTable, populate it basing on the other columns data and some conditions, then bind to the Store. Generally, yes, I can't see a better solution.
  5. #5
    Ok, thanks Daniil.

    I'll walk that way.

    You may close this thread.

    Regards
    Fernando

Similar Threads

  1. [CLOSED] Creating custom control on server side
    By AnulekhaK in forum 1.x Legacy Premium Help
    Replies: 11
    Last Post: Feb 21, 2012, 10:15 AM
  2. Replies: 2
    Last Post: Sep 28, 2011, 8:28 AM
  3. Replies: 0
    Last Post: Jun 21, 2011, 2:51 AM
  4. Replies: 12
    Last Post: Jun 05, 2011, 8:08 PM
  5. [CLOSED] Hiding GridPanel column server side
    By methode in forum 1.x Legacy Premium Help
    Replies: 7
    Last Post: Nov 18, 2008, 3:04 AM

Tags for this Thread

Posting Permissions