Totally baffled by this.
If I type in the javascript it works, but if I use PHP on the server-side to generate the exact same javascript, then the table still displays but the popup window when you click 'Edit' has no fields.
Here's an example:
|
1 2 3 4 |
colModel :[<br /> {name:'id', index:'id', editable:false,},<br /> {name:'role', index:'role', editable:true, editoptions:{size:20}},<br /> ],<br /> |
but if I generate that code with something like this:
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
foreach($fields as $field){<br /> $column = "";<br /> $column .= "{";<br /> $column .= "name:'" . $field . "',";<br /> $column .= "index:'" . $field . "',";<br /> if($field == "id"){<br /> $column .= "editable:'false',";<br /> } else {<br /> $column .= "editable:'true',";<br /> $column .= "editoptions:{size:20}";<br /> }<br /> $column .= "},";<br /> echo $column;<br /> $columns .= $column;<br /> }<br /> |
then the table still displays but the popup window when you click 'Edit' has no fields.
Why?
Copyright 2014 TriRand LtdAll Rights ReservedRSS
Back to Top