Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

 
Reply to this topicStart new topic
> external filter checkbox dla table sortera
Kishin
post 12.07.2014, 13:17:17
Post #1





Grupa: Zarejestrowani
Postów: 148
Pomógł: 17
Dołączył: 20.12.2011

Ostrzeżenie: (0%)
-----


Witam,

Taki problem, mam sobie tabelke z danymi w table sorterze i chciałbym mieć w tej tabelce filtr, niestety tablesorter niema opcji filtru z multiple selectem wiec próbuje coś utworzyć na własną ręke z external filter.
I ogólnie wygląda ok tylko tak:
Mam checkboxy, którego po kliknięciu wartości przerzucam do submita z odstępami "||" i do tego momemtu wszystko działa ok natomiast external filter nie zaciąga tych danych z inputa zanim nie dopisze czegokolwiek w tym inpucie.
W sumie to potrzebuje jakiejś funkcji która symuluje dopisywanie czegoś do inputa bez dopisywania czegokolwiek smile.gif


  1. <script>function testCheckBoxes(){
  2. var boxChecked = "";
  3. for (var counter = 0; counter < document.form.grupa.length; counter ++){
  4. if(document.form.grupa[counter].checked){
  5. var wartosc=document.form.grupa[counter].value
  6. boxChecked +=(wartosc+'||');
  7. }
  8. }
  9. document.getElementById("textField2").value = boxChecked;
  10.  
  11. }
  12.  
  13. $(function() {
  14.  
  15. // call the tablesorter plugin
  16. $(".filter").tablesorter({
  17. theme: 'metro-dark',
  18.  
  19.  
  20. // hidden filter input/selects will resize the columns, so try to minimize the change
  21.  
  22.  
  23. // initialize zebra striping and filter widgets
  24. widgets: ["zebra", "filter"],
  25.  
  26. // headers: { 5: { sorter: false, filter: false } },
  27.  
  28. widgetOptions : {
  29. // filter_anyMatch replaced! Instead use the filter_external option
  30. // Set to use a jQuery selector (or jQuery object) pointing to the
  31. // external filter (column specific or any match)
  32. filter_external : '.search',
  33. // include column filters
  34. filter_columnFilters: true,
  35.  
  36. filter_saveFilters : true,
  37. filter_reset: '.reset',
  38. filter_searchDelay : 300
  39. }
  40.  
  41.  
  42. });
  43.  
  44. });
  45. </script>



Nikt niema pomysłu? :/
Go to the top of the page
+Quote Post

Reply to this topicStart new topic
1 Użytkowników czyta ten temat (1 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Wersja Lo-Fi Aktualny czas: 24.07.2025 - 17:49