[Koha-bugs] [Bug 31842] admin/branches: DT search generates js error on col.data.split
bugzilla-daemon at bugs.koha-community.org
bugzilla-daemon at bugs.koha-community.org
Wed Oct 19 10:43:56 CEST 2022
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31842
--- Comment #10 from Jonathan Druart <jonathan.druart+koha at gmail.com> ---
(In reply to Marcel de Rooy from comment #7)
> (In reply to Jonathan Druart from comment #4)
> > (In reply to Jonathan Druart from comment #3)
> > > It's not a problem to have a function defined for 'data', it just should not
> > > be searchable.
> >
> > Do you agree with that?
>
> Hmm. It looks a bit inconsistent. I prefer the move to render now. And it
> works.
Ok but if you keep data:function and set searchable to false, it also works.
"It works" is not enough ;)
(In reply to Marcel de Rooy from comment #8)
> (In reply to Jonathan Druart from comment #3)
> > + "data": "actions",
> >
> > There is some magic in datatables.js that is using this (for sorting,
> > searching, etc.) and expect it to be an attribute of library. I would not
> > use "actions".
>
> Where can I find that? We can change these "labels" where needed..
"data" is not a label
https://datatables.net/reference/option/columns.data
vs
https://datatables.net/reference/option/columns.render
`data: "actions"` does not mean anything.
The magic is: the DT REST API wrapper is using the "data" value to build the
table, it must be a value returned by the REST API response.
(In reply to Marcel de Rooy from comment #9)
> I do see an action function but I dont see actions in datatables.js
See above. Occurrences are:
583 var attributes = col.data.split(':');
607 return col.bSearchable && typeof
col.data == 'string' && data.columns[col.idx].search.value != ''
685 var order_by =
options.columns[order_col].data;
--
You are receiving this mail because:
You are watching all bug changes.
More information about the Koha-bugs
mailing list