Mevrael / bunny

BunnyJS - Lightweight native (vanilla) JavaScript (JS) and ECMAScript 6 (ES6) browser library, package of small stand-alone components without dependencies: FormData, upload, image preview, HTML5 validation, Autocomplete, Dropdown, Calendar, Datepicker, Ajax, Datatable, Pagination, URL, Template engine, Element positioning, smooth scrolling, routing, inversion of control and more. Simple syntax and architecture. Next generation jQuery and front-end framework. Documentation and examples available.
https://bunnyjs.com
MIT License
486 stars 39 forks source link

fix(Pagination) detect existence of question mark in URL in order to use correct parameter separator when adding parameters to the URL #8

Closed joebordes closed 7 years ago

joebordes commented 7 years ago

The ajax URL I use to retrieve data has parameters:

index.php?param1=val1&param2=val2....

so when the pagination code adds the "page" parameter with a hardcoded question mark it doesn't work correctly. I added an "if" to detect the existence of a question mark in order to set the correct parameter separator and it is working correctly in both case.

joebordes commented 7 years ago

I think you may have to update the datatable website also:

https://bunnyjs.com/examples/datatable/

* url=”string” - ajax URL without any params...

I think you can delete the "without any params"

Thanks for accepting the merge

Mevrael commented 7 years ago

Thanks.

Later BunnyURL there should be used since it is already a dependency for DataTable.

I've added to DataTable search option which is not documented yet. If you will need it just create input with name="search" within <datatable>.

P.S. Instead of var it is recommended now to use const or let. Here is good video explaining https://www.youtube.com/watch?v=sjyJBL5fkp8

joebordes commented 7 years ago

That video was very enlightening. I take note. Thanks :-)