如何使用 infyom laravel-generator 数据表添加"Column Search"



是否可以添加"列搜索";带有infyom laravel生成器yajra数据表。

我将tables_searchable_default从false更改为true

形成此文档https://www.infyom.com/open-source/laravelgenerator/docs/8.0/configuration#options

但它不会改变任何事情。。。

有解决方案吗?

提前感谢。

我对Infyom Gihthub 的回答

https://github.com/InfyOmLabs/laravel-generator/issues/972

我是如何做到的(在yajra/datables.html/builler中做了一点修改-参见步骤5(

0-https://datatables.net/examples/api/multi_filter.html
◦ reference example
1-php artisan infyom.publish:templates
2-resources/infyom/infyom-generator-templates/scaffold/views/datatable_body.stub

datatable_body.stub@部分("ird_party_stylesheets"(@include('layouts.datatables_css'(@端部

{-$dataTable->表{!!$dataTable->表

3 config/datatables-html.php
'数据表::脚本','script'=>'layouts/script',];4个资源/views/layouts/script.blade.php$(document(.ready(function({//设置-向每个页脚单元格添加文本输入$("#dataTableBuilder tfoot th"(.each(function(({var title=$(this(.text((;$(this(.html("(;}(;});$(function(({window.{{config('datatables-html.namespace','LaravelDataTables'(}}=window。{{config('datatables-html.namespace','LaravelDataTables'(}}| |{};窗{{config('datatables-html.namespace','LaravelDataTables'(}}["%1$s"]=$("#%1$s"(.DataTable(%2$s,initComplete:函数(({//应用搜索this.api((.columns((.every(function(({var that=this;$("input",this.footer(((.on("keyup change clear",function(({if(this.search((!==this.value({那个.search(this.value(.draw((;}}(;}(;}}(;});5•供应商/yajra/laravel数据表html/src/html/Builder.php公共函数generateScript(({$parameters=$this->generateJson((;$parameters=substr($parameters,0,strlen($paramerences(-1(;#删除最后一个}以便添加参数返回新的HtmlString(sprintf($this->template((,$this->getTableAttribute('id'(,$parameters();}

相关内容

  • 没有找到相关文章