@@ -142,6 +142,26 @@ public function mount(
142142
143143 };
144144
145+ $ this ->addSearchable ();
146+
147+ }
148+
149+ public function addSearchable ()
150+ {
151+ foreach ($ this ->selectedCols as $ col => $ value ) {
152+ if ($ value ['searchable ' ]) {
153+ if (!in_array ($ col , $ this ->cols ['searchable ' ])) {
154+ array_push ($ this ->cols ['searchable ' ], $ col );
155+ }
156+ } else {
157+ if (in_array ($ col , $ this ->cols ['searchable ' ])) {
158+ $ key = array_search ($ col , $ this ->cols ['searchable ' ]);
159+ unset($ this ->cols ['searchable ' ][$ key ]);
160+ }
161+ }
162+ }
163+
164+ //dd($this->cols['searchable']);
145165 }
146166
147167
@@ -150,11 +170,15 @@ public function reload()
150170 $ this ->colbox = true ;
151171 //dd($this->ckeys);
152172
153- $ cscols = $ this ->getCache ($ this ->ckeys ['selectedCols ' ]);
154- $ ccols = $ this ->getCache ($ this ->ckeys ['columns ' ]);
173+ //$cscols = $this->getCache($this->ckeys['selectedCols']);
174+ //$ccols = $this->getCache($this->ckeys['columns']);
175+
176+ //$this->selectedCols = (empty($cscols)) ? $this->selectedCols : $cscols;
177+ //$this->columns = (empty($ccols)) ? $this->columns : $ccols;
155178
156- $ this ->selectedCols = (empty ($ cscols )) ? $ this ->selectedCols : $ cscols ;
157- $ this ->columns = (empty ($ ccols )) ? $ this ->columns : $ ccols ;
179+ $ c = $ this ->initCache ($ this ->table_name , true );
180+ if ($ c ) $ this ->addSearchable ();
181+ //$this->addSearchable();
158182 }
159183
160184 public function dbModal ()
0 commit comments