MCPcopy Create free account
hub / github.com/CoderOpen/waimai / grid

Method grid

app/Admin/Controllers/ChiHe/ProjectController.php:32–137  ·  view source on GitHub ↗

* Make a grid builder. * * @return Grid */

()

Source from the content-addressed store, hash-verified

30 * @return Grid
31 */
32 protected function grid()
33 {
34 //$localAppId = request()->get('local_app_id', 0);
35 $csrf = csrf_token();
36 $script = <<<EOT
37 $('.grid-row-delete').unbind('click').click(function() {
38 var id = $(this).data('id');
39 var type = $(this).data('type');
40 swal({
41 title: "确认删除",
42 type: "warning",
43 showCancelButton: true,
44 confirmButtonColor: "#DD6B55",
45 confirmButtonText: "确认",
46 showLoaderOnConfirm: true,
47 cancelButtonText: "取消",
48 preConfirm: function() {
49 $.ajax({
50 method: 'post',
51 url: '/admin/series-product/delete/' + id + '?type=' + type,
52 data:{
53 _token:"$csrf"
54 },
55 success: function (data) {
56 $.pjax.reload('#pjax-container');
57 console.log(data);
58 if(data.code == 1){
59 swal(data.msg, '', 'success');
60 }else{
61 swal(data.msg, '', 'error');
62 }
63 }
64 });
65 }
66 });
67 });
68EOT;
69 Admin::script($script);
70
71 $comment = (new Project());
72 $showStatus = Link::showStatus();
73 $grid = new Grid($comment);
74 //$grid = $grid->model()->with('local_app');
75 //$grid->disableFilter();
76 $grid->column('id', 'ID')->sortable();
77 $grid->disableExport(); //禁止导出
78 $grid->disableRowSelector(); //禁止行checkbox选择
79 $grid->disableColumnSelector(); //禁止显示列显示选择器
80 //$grid->disableActions();
81 //$grid->disableCreateButton();
82 $localAppId = '';
83
84
85 //$grid->disableActions();//$grid->column('pictures', '图片')->editable();
86 //$grid->column('localapp.app_name', '应用');
87 $grid->column('app_id', '项目应用ID');
88 $grid->column('title', '项目名称');
89 //$grid->column('path', '跳转链接')->editable();

Callers

nothing calls this directly

Calls 2

getMethod · 0.80
showStatusMethod · 0.45

Tested by

no test coverage detected