[CLOSED] Component Column Renderer from CodeBehind In mvc

  1. #1

    [CLOSED] Component Column Renderer from CodeBehind In mvc

    How to set Renderer for component column from code behind.i use http://mvc.ext.net/#/GridPanel_Array...vent_Creation/ and just change column Price as component column and try
    Renderer = { Handler = "Ext.util.Format.indianMoney" },
    Ext.util.Format.indianMoney = function (v) {
       
        v = String(v).replace(/[^0-9.\-]/g, "");
        v = (Math.round((v - 0) * 100)) / 100;
        v = (v == Math.floor(v)) ? v + ".00" : ((v * 10 == Math.floor(v * 10)) ? v + "0" : v);
        v = String(v);
    
        var ps = v.split('.'),
            whole = ps[0],
            sub = ps[1] ? '.' + ps[1] : '.00',
            r = /(\d+)(\d{3})/;
    
       // while (r.test(whole)) {
    
           // whole = whole.replace(r, '$1' + ',' + '$2');
       // }
    
        return  "₹ "+ whole + sub ;
    };
    but not working ,please help.
    Last edited by Daniil; Nov 27, 2014 at 5:48 AM. Reason: [CLOSED]
  2. #2
    Hi @matrixwebtech,

    A ComponentColumn's doesn't support a custom Renderer. Internally, it uses its own Renderer function to actually render its Component.

    You can use your format function for a regular Column.
    new Column
    {
        Renderer =
        {
            Handler = "return Ext.util.Format.indianMoney(value);"
        }
    };
  3. #3
    For regular columns its fine ,I am facing no problem with custom column Renderer.so,Component Column's custom Renderer is not possible?
  4. #4
    so,Component Column's custom Renderer is not possible?
    Yes, it is not possible. In the case with a ComponentColumn you should deal with its Component only.
  5. #5
    I put a TextField inside component column .can I set a Renderer for the TextField
  6. #6
    Unfortunately, there is no such the functionality.

    Searching the forums you might find some attempts to achieve similar things.
    http://forums.ext.net/showthread.php...l=1#post104409
  7. #7
    hi daniil
    thanks for the information.this thread can be close.and one more thing,how you search on forum,your provided links are exact ,can you please let me know the technique.
    Last edited by matrixwebtech; Nov 27, 2014 at 3:15 AM.
  8. #8
    and one more thing,how you search on forum,your provided links are exact ,can you please let me know the technique.
    Usually I start to search via "Tag" here.
    http://forums.ext.net/search.php

    For example, try to type "grid". A dropdown list appears with possible options. Pick one and search. Please note that the forum members associate tags to threads. So, there might be anything.

    If nothing, I search via "Keyword(s)" in Titles, then in Posts.

    If nothing, I try to search via a regular Google. You can see the search box at any forum page.

    Sometimes I change the sequence of search options (that I described above). It depends on what I am looking for. It is hard to explain why I prefer one or another from time to time:)

    Also, probably the most important thing is keywords. What you type to search.

Similar Threads

  1. Replies: 2
    Last Post: Aug 21, 2014, 9:55 AM
  2. [CLOSED] Gridpanel component Column in CodeBehind
    By ebeker in forum 2.x Premium Help
    Replies: 3
    Last Post: Nov 07, 2013, 10:39 PM
  3. Replies: 2
    Last Post: Jun 27, 2013, 11:18 PM
  4. Replies: 1
    Last Post: Mar 12, 2013, 11:35 AM
  5. Replies: 1
    Last Post: Dec 06, 2012, 4:27 PM

Posting Permissions