0

我有一个文本类型的 gridview 列。

<sjg:gridColumn id="vName" name="variableName" index="variableName" title="Variable_Name" sortable="true" editable="true" edittype="text"/>

我想将字符串“C:\”附加到动态文本框内容。我该怎么做?我尝试使用此脚本,但它不工作

var myString="C:\";
$('#vName').append(myString); 
4

1 回答 1

0

您可以简单地设置自定义格式功能:

列的colModel里面

   ....
   formatter: CustomFormatFunction, unformat: CustomUnFormatFunction},
   ....

自定义格式功能:

function CustomFormatFunction(cellval, opts, rowObject, action) {
   return "c:\" + cellval;
}

function CustomUnFormatFunction(cellval, opts, rowObject, action) {
   return cellval; //or manipulate the string to remove the "c:\"
}
于 2013-05-09T12:46:02.553 回答