簡體   English   中英

Dojo網格:從格式化程序訪問另一個屬性

[英]Dojo grid: accessing another attribute from a formatter

我有一個Dojo EnhancedGrid。 假設我想在一列中顯示員工的姓名作為鏈接,並且URL的標題中必須包含員工ID。

網格中的行:

structure:[
  {name:"Name", field:"name", datatype:"string", formatter:createLink},
...

格式化程序:

var createLink = new function(name){
  return "<a href=\"/somepage.php?id=" + employeeID + "\">" + name + "</a>";
}

如何獲取格式化程序中employeeID的值?

完全不同的方法也非常受歡迎!

ps(如果相關),則網格使用的是包裝JsonRest實例的ObjectStore。

function formatter(value, idx) {
    var gridRow = theGrid.getItem(idx);
    //gridRow["property"]; //some property from the store
}

這對我有用。 希望能幫助到你。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM