Took a few days ago a remote system upgrade, it is in the form of flexgrid, there is a demand is needed, according to the value of the field display different content such as 1, 2 show unfinished, and so on, because it is difficult to find, flexgrid data now has the website can't access, online search results only one customValue, but did not find any related content in the source code, doubt wrong information or flexgrid versions of itself, I finally solved this problem by changing the source code, the record, convenient and other users to use this component,
The search process in the source code to perform only, at about 734 lines of position (flexgrid. Pack. Js), behind which increase
If (PTH!=null) {//process to perform only
If (PTH) process)
PTH process (tdDiv, pid);
}
//new content
If (PTH!=null) {//template of new
If (PTH) template)
TdDiv. InnerHTML=PTH. Template (tdDiv innerHTML, pid);
}
At the same time, the search for $(tr). Append (th); Around 850 lines, on top of it to join
If (cm. The template) {
Th. Template=cm. The template;
}
After save, when defined columns can use
{
Display: 'results' name: "status", width: 100, sortable: false, align:' left ', the template: function (value, pid) {
The switch (value) {
Case 0: return "no"; break;
Case 1: return "& lt; Span style="color: # 019858 & gt; Complete & lt;/span> "; break;
Case 2: return "& lt; Span style="color: # F75000 & gt; Unfinished & lt;/span> "; break;
}
}
},