JQuery Easyui combined with thinkphp, about reading data display related issues

Source: Internet
Author: User
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 " "" ; endforeach;endif;?> '; $parseStr. = '
". $key.
';

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.
  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.