[BlueOnyx:21774] Re: save the values of select box of "show 10 entries" *** done! ***

Michael Stauber mstauber at blueonyx.it
Sat Feb 17 11:54:46 -05 2018


Hi Michael,

> look for: this._iDisplayLength=10

Thank you very much for digging this up. Knowing which variable to look
for made the change much easier for me. It's been four years since I
worked on that part of the code, so these details escaped me.

I just published updates for 5207R, 5208R, 5209R and 6108R that now keep
track of whatever value you had chosen in the pulldown and retain it for
all displays of this type until you modify the pulldown again.

Here is how I did it: I looked at the code for the ScrollLists and found
out that I already had made the value configurable. When creating a
ScrollList (that's how we call this UI-element) I could say: "Instead of
the default 10, set it to something else."

So I just tied into that functionality and made two changes in
base-alpine. In "pluginsmin" I set a cookie whenever a ScrollList is
updated:

document.cookie = "SLdisplay" + "=" + e._iDisplayLength + ";
expires=Fri, 31 Dec 9999 23:59:59 GMT" + "; path=/";

That stores the 'iDisplayLength' in the cookie.

In uifc/ScrollList.php I simply check if the cookie is set and if so,
then that value is used during the setup of ScrollList to externally
populate 'iDisplayLength'.

-- 
With best regards

Michael Stauber



More information about the Blueonyx mailing list