From 5c65139d294f80397129780c1c680ef103d8b2d8 Mon Sep 17 00:00:00 2001 From: Victor Ocio Date: Mon, 18 Jul 2022 01:38:02 +0200 Subject: [PATCH] documentation --- README.md | 71 +++++++++++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 66 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index c469c40..7bd1e7b 100644 --- a/README.md +++ b/README.md @@ -213,14 +213,14 @@ Will produce the following script. ``` ### types of inputs to search in colunms: -Now hava 4 types of inputs: +Now have 4 types of inputs: input select select multiple date to define the type of search need in definition of columns especificate this array: -``` +```php 'searchInput' => [ 'type' => '', 'options' => [ @@ -229,9 +229,70 @@ to define the type of search need in definition of columns especificate this arr ], ``` -
- example of search select -
+# for input type text: +not need make anything is for default: + +# for type select: +```php +'searchInput' => [ + type => 'select', + 'options' => [ + ['id' => 1, 'name' => 'one'], + ['id' => 2, 'name' => 'two'], + .... + ] +], +``` + +# for type multiple: +```php +'searchInput' => [ + type => 'multiple', + 'options' => [ + ['id' => 1, 'name' => 'one'], + ['id' => 2, 'name' => 'two'], + .... + ] +], +``` +# for type date: +need jquery-ui or jquery-datepicker +```php +'searchInput' => [ + type => 'multiple', + 'options' => [], +] +``` + +is need to integrate for columns definition: + +ejample: +```php + +Datatable->setFields([ + [ + 'name' => 'user_id', + 'searchInput' => [ + 'type' => 'select', + 'options' => [ + ['id' => 1, 'name' => 'one'], + ['id' => 2, 'name' => 'two'], + .... + ] + ], + 'render' => ' + function(data, type) { + return Math.floor(Math.random() * 1000); + } + ' + ] +]); ?> +``` +in options is posible utilize find('list) and put names id and name. +if not want to search column is necesary to especify this, + +```php 'searchable' => false, ``` + # Getting the datatable script. All you need is to tell the help to create the script for you, pass the tag id to be used for