@@ -172,6 +172,7 @@ public function parameterize($attributes = [])
172172list ($ ajaxDataFunction ,$ parameters ) =$ this ->encodeAjaxDataFunction ($ parameters );
173173list ($ columnFunctions ,$ parameters ) =$ this ->encodeColumnFunctions ($ parameters );
174174list ($ callbackFunctions ,$ parameters ) =$ this ->encodeCallbackFunctions ($ parameters );
175+ list ($ editorButtons ,$ parameters ) =$ this ->encodeEditorButtons ($ parameters );
175176
176177$ json =json_encode ($ parameters );
177178
@@ -180,10 +181,47 @@ public function parameterize($attributes = [])
180181$ json =$ this ->decodeAjaxDataFunction ($ ajaxDataFunction ,$ json );
181182$ json =$ this ->decodeColumnFunctions ($ columnFunctions ,$ json );
182183$ json =$ this ->decodeCallbackFunctions ($ callbackFunctions ,$ json );
184+ $ json =$ this ->decodeEditorButtons ($ editorButtons ,$ json );
183185
184186return $ json ;
185187 }
186188
189+
190+ /**
191+ * Encode DataTables editor buttons.
192+ *
193+ * @param array $parameters
194+ * @return array
195+ */
196+ protected function encodeEditorButtons (array $ parameters )
197+ {
198+ $ editorButtons = [];
199+ if (isset ($ parameters ['buttons ' ])) {
200+ foreach ($ parameters ['buttons ' ]as $ i =>$ button ) {
201+ if (isset ($ button ['editor ' ])) {
202+ $ editorButtons [$ i ] =$ this ->compileCallback ($ button ['editor ' ]);
203+ $ parameters ['buttons ' ][$ i ]['editor ' ] ="#editor_button. {$ i }# " ;
204+ }
205+ }
206+ }
207+ return [$ editorButtons ,$ parameters ];
208+ }
209+
210+ /**
211+ * Decode DataTables Editor buttons.
212+ *
213+ * @param array $editorButtons
214+ * @param string $json
215+ * @return string
216+ */
217+ protected function decodeEditorButtons (array $ editorButtons ,$ json )
218+ {
219+ foreach ($ editorButtonsas $ i =>$ function ) {
220+ $ json =str_replace ("\"#editor_button. {$ i }# \"" ,$ function ,$ json );
221+ }
222+ return $ json ;
223+ }
224+
187225/**
188226 * Get table computed table attributes.
189227 *