4

グリッドでrowTemplateを使用すると、数値形式が機能しません。

rowTemplateの行番号形式が正常に機能しているとコメントすると、rowTemplateと形式のb / wに関係があります{0,n0}か?ここでは、データベースからプロパティ値を取得するために行テンプレートを使用しています。

<script id="SellTemplate" type="text/x-kendo-tmpl">
    <tr>
        <td>
            ${Fore}
        </td>           
        <td align="Left">    
            <img src="/Images/${ Indicator }.png"  width="20" height="20" />          
        </td>
    </tr>
</script>

$("#grid1").kendoGrid({
    width: 1500,
    dataSource: data.d,
    resizable: true,
    rowTemplate:kendo.template($("#SellTemplate").html()),;
    kendo.template($("#SellTemplate").html()),
    height: 750,                                
    selectable: true,
    columns: [
        { title: 'Fore', field: 'Fore', width: '12%', format: "{0:n0}", sortable: true },
        { title: 'Indicator', field: 'Indicator', width: '4%', sortable: true},
    ]
});
4

1 に答える 1

3

指定するrowTemplateと、グリッド行のレンダリングを完全に制御できます。組み込みの行テンプレートは、カスタムテンプレートによって上書きされます。ただし、値をフォーマットすることはできます-テンプレートでkendo.format関数を使用します。

    <td>
        ${kendo.format("{0:n0}", Fore)}
    </td> 
于 2012-12-12T15:41:57.887 に答える