JQuery Easyui combined with thinkphp, about reading data display problems
The original project wrote a Easyui class, which wrote a Datagrig () method
Public Function _datagrid ($tag) {
$id =!empty ($tag [' id '])? $tag [' id ']: strtolower (controller_name. ') _'. Action_name. ' _datagrid ');
$style =!empty ($tag [' style '])? $tag [' style ']: ';
Default parameters
$dataOptions = Array (
' Border ' = False,
' Fit ' = true,
' Fitcolumns ' = true,
' Rownumbers ' = true,
' Singleselect ' = true,
' Pagination ' = true,
' PageList ' = Array (20,30,50,80,100),
' PageSize ' = Cookies (' PageSize ')? Cookie (' pagesize '): C (' datagrid_page_size '),
);
$options = $tag [' Options ']? $this->autobuildvar ($tag [' Options ']): ' Array () ';
$fields = $tag [' Fields ']? $this->autobuildvar ($tag [' Fields ']): ' null ';
$PARSESTR = '
\ ' style= '. $style. ' " >
'; $parseStr. = ' $arr): if (isset ($arr [\ ' Formatter\ ']): unset ($arr [\ ' Formatter\ ']); Endif;echo "
| ". $key. | "" ; endforeach;endif;?> '; $parseStr. = '
';
return $parseStr;
}
This is the logic in the controller.
$datagrid = Array (
' Options ' = Array (
' title ' = $currentpos,
' url ' = = U (' uc/pages ', Array (' grid ' = ' datagrid ') '),
' Toolbar ' = ' Uc_pages_datagrid_toolbar ',
),
' Fields ' = = Array (
' page ' = = Array (' field ' = ' page ', ' width ' =>15, ' sortable ' =>true),
' Access ' = = Array (' field ' = ' private ', ' width ' =>15, ' sortable ' =>true),
' management operations ' = = Array (' field ' = ' = ' id ', ' width ' =>15, ' formatter ' = ' ucpagesoperateformatter '),
)
);
$this->assign (' DataGrid ', $datagrid);
The page refers to the tag, and the data comes out.
Now the problem is that this is the pages table of operations, with the field ID, page, private,private value 0 or 1, the controller uses field= " Private ' displays 0 or 1 on the page, but our requirement is that when the database Privat field value is 0 o'clock the page shows public, 1 o'clock, and the page shows private. Do not change the contents of the table, structure, that is, the table, how to operate to achieve it? Please help me to see, thank you!
------Solution--------------------
------Solution--------------------
Well, it'll easyui, not PHP.