Search code examples
javascriptasp.net-mvc-4ext.netrenderer

migration of Ext.Net 1.6 to Ext.Net 2.1 with MVC destroys renderer functionality


So i have some large project for which i am creating a sample of migration from Ext.Net 1.6 to Ext.Net 2.1 with MVC 4. Doing so i have stumbled upon the Error, that (after making my web-application conform with my Master Page) the renderer for my GridColumn throws following Errors:

Uncaught TypeError: Object function String() { [native code] } has no method 'format' 
Uncaught TypeError: Cannot call method 'removeChild' of null

the renderer is in the "HeadContent" Placeholder while the GridPanel is in "MainContent"

Renderer function looks as follows:

<script type="text/javascript">
    var template = '<span style="color:{0};">{1}</span>';

    var listname = function (value, meta, record) {
        return String.format(template, (record.data.blockstatus == "free") ? "green" : "red", value);
    };
</script>

a general sample page for the use of ext.net does work without any problems.

Any Ideas on how to fix this?


Solution

  • In Ext JS 4, the String.format was removed and replaced with the Ext.String.format function. More information available in the Ext JS documentation, see

    http://docs.sencha.com/ext-js/4-2/#!/api/Ext.String-method-format

    Also see item #40 of the Ext.NET 2.0 Breaking Changes,

    http://examples.ext.net/#/Getting_Started/Introduction/BREAKING_CHANGES/

    Hope this helps.