2012-03-14 85 views
0

我有「rowexpander」的網格。與此我能夠擴大行,並能夠顯示內容.i.e。 html複選框。 現在我的要求是在我的數據庫中我得到的值是真或假。所以取決於值,即真正我想顯示覆選框與選中。行擴展器檢查條件

這是我的代碼。

plugins: [ 
{ 
    ptype: 'rowexpander', 
    rowBodyTpl: 
    ['<ul><li><input type="checkbox" name="" checked={marginAccess} ><span>Margin Access for Quote</span></li></ul> '] 
} 

現在{} marginAccess的時候是真的我想顯示「」 即檢查=檢查

我不能做到這一點,你可以請建議我嗎?

+0

你在督察中看到了什麼?在這個擴展行中生成的HTML是什麼? – sha 2012-03-14 11:45:29

+0

Anup 2012-03-14 12:07:16

+0

真的嗎?大括號? {}? – sha 2012-03-14 12:08:42

回答

1

在您的模型中創建一個虛擬成員。其中一個將返回'checked/unchecked'作爲其他字段的真/假值。像這樣:

{ name: 'marginAccess_str', type: 'string', convert: function(v, r) { 
    if (r.get('marginAccess')) 
    return 'checked'; 
    else 
    return 'unchecked'; 
}}, 

然後在模板中使用marginAccess_str。

+0

非常感謝幫助 – Anup 2012-03-14 13:36:11