/** * 测试页面:基础UI设置 */ public function testUIBase() { // $msg = ''; //$msg='页面设置'; importMyLib('MAdminUIComponent'); $rOneForm = new MAdminUIComponent(site_url('rm/user/editorUploadJson'), site_url('rm/user/editorFileManagerJson')); $rOneForm->setFormTitle('测试页面:基础UI设置'); $rOneForm->setFormBtnGotoUrl('btnurl', '点击去百度', 'http://www.baidu.com'); $rOneForm->setFormTxt('title', '标题', '12312'); $rOneForm->setFormSelect('cate', '分类', array(array('分类1', 1), array('分类2', 2), array('分类3', 3))); $rOneForm->setFormRadio('color', '颜色', array(array('红', 1), array('蓝', 2), array('白', 3))); $rOneForm->setFormCheckbox('color', '多选参数', array(array('参数1', 1), array('参数2', 2), array('参数3', 3), array('参数4', 4), array('参数5', 5), array('参数6', 6), array('参数7', 7)), array(1, 4, 6)); $rOneForm->setFormUpOneImg('img', '缩略图', 'remarks', ''); $rOneForm->setFormEditor('remarks', '备注', ''); $rOneForm->setFormBtnSubmit('addSubmit', 'User', 'add'); // importMyLib('MAdminUIGrid'); $rGrid = new MAdminUIGrid(); $idname = 'myjqxgird'; $jqxgrid_parent_name = 'jqxWidget'; $datafields = $rGrid->getBatSetColumns(array(array('First Name', 'firstname', 1), array('Last Name', 'lastname', 1), array('Product', 'productname', 1), array('Quantity', 'quantity', 2), array('Price', 'price', 2))); $selectOptions = null; $jquGridUrl = '/makeigameSite/index.php/mangement/testUIGridData'; //编辑的地址有点特殊,因为它是直接调用js的加载页的方法:MainJS.goSubPage() 如有连接信息需要用冒号隔开 //注:如果需要传入控制方法的参数需要用/连接,例如:mangement:userList/1 $urlEdit = 'mangement:testUIBaseEdit'; $urlDel = '/makeigameSite/index.php/mangement/testUIBaseDel'; $urlOpbat = '/makeigameSite/index.php/mangement/testUIBaseOp'; $gridTem = $rGrid->getRenderData($jquGridUrl, $urlEdit, $urlDel, $urlOpbat, $idname, $jqxgrid_parent_name, $datafields, $selectOptions, $this->_getConfigAdminGridPageSize()); //注:最终js读取的是这种格式 $arrRender = array($rOneForm->getRenderData(), $gridTem); $this->responseAjaxSucess(array('render' => $arrRender)); }
protected function moduleShowList($t, $otherConfig) { $c_id = 0; if (isset($otherConfig['c_id'])) { $c_id = intval($otherConfig['c_id']); } //默认显示列表 //以下是测试格式' ///* $rOneForm = $this->getModuleAddEditPublicPart('分类测试:添加分类'); if ($pid != 0) { $arrResult = $this->getOneSqlData($c_id); $ppid = $arrResult['c_id']; //上一级的c_id的值 //$rOneForm->setFormBtnSubmit('btnRegoParent',$this->currentControlName,$this->currentActionName); } //生成表格 importMyLib('MAdminUIGrid'); $rGrid = new MAdminUIGrid(); $idname = 'myjqxgird'; $jqxgrid_parent_name = 'jqxWidget'; //每条记录对应:$text,$datafield,$type,$columngroup='group2',$width=0,$editable=false $datafields = $rGrid->getBatSetColumns(array(array('标题', 'title', 1), array('排序', 'sortindex', 1, 40), array('上级', 'c_id', 2, 100))); $selectOptions = null; $strPathPrefix = $this->currentControlName . '/' . $this->currentActionName . '/'; $jquGridUrl = site_url($strPathPrefix . '0/' . $pid); //'/makeigameSite/index.php/mangement/testModuleCate/0'; $urlEdit = $this->currentControlName . ':' . $this->currentActionName . '/1'; //'mangement:testModuleCate/1'; //编辑的地址有点特殊,因为它是直接调用js的加载页的方法:MainJS.goSubPage() 如有连接信息需要用冒号隔开 $urlDel = site_url($strPathPrefix . '2'); //'/makeigameSite/index.php/mangement/testModuleCate/2'; $urlOpbat = site_url($strPathPrefix . '3'); //'/makeigameSite/index.php/mangement/testModuleCate/3'; $arrBtnLinks = array($rGrid->getItemColumnBtnLink('下级分类', site_url($strPathPrefix . '5'), 80)); //设置自定义的数组 //$arrBtnLinks[]=$rGrid->getItemColumnBtnLink('测试',$urlOpbat); $gridTem = $rGrid->getRenderData($jquGridUrl, $urlEdit, $urlDel, $urlOpbat, $idname, $jqxgrid_parent_name, $datafields, $arrBtnLinks, $selectOptions, $this->AC->_getConfigAdminGridPageSize()); //注:最终js读取的是这种格式 $arrRender = array($rOneForm->getRenderData(), $gridTem); $this->AC->responseAjaxSucess(array('render' => $arrRender)); }