Issues when using the datatables request

Issues when using the datatables request

maniyamaniya Posts: 78Questions: 13Answers: 0

I am using datatable POST and it goes into 302 found, but when i switch it back to GET

the page does not load if i pass
&columns[11][orderable]=false&columns[11][search][value]=&columns[11][search][regex]=false

i have 12,13,14 also

so any idea what is going on

This question has an accepted answers - jump to answer

Answers

  • maniyamaniya Posts: 78Questions: 13Answers: 0

    I am following this request

    https://datatables.net/forums/discussion/22128/is-it-possible-to-restrict-what-parameters-are-posted-on-the-ajax-url

    but in this case, i have this one after ajax how can i add this

    "data": function (d) {
                                return $.extend({}, d, {
                                "DateDebut": $('#DateDebut').val(),
                                "DateFin": $('#DateFin').val(),
                                "ticketType":$('#ticketType option:selected').toArray().map(function(item) { return item.value; }).join(),
                                "finalStatus": $("#finalStatus option:selected").toArray().map(function(item) { return item.value; }).join()
                            });
                        }
    
  • kthorngrenkthorngren Posts: 21,443Questions: 26Answers: 4,974

    I am using datatable POST and it goes into 302 found, but when i switch it back to GET

    Is your server side script set to process GET requests? The place to start is with debugging the server side script.

    Kevin

  • maniyamaniya Posts: 78Questions: 13Answers: 0

    i can either do get or post both, i am debugging it since weekend, its not working in get or post, if i use get, i get 404 not found and if i use post, i get 302 found

    so i thought it could be an solved if use get with limited passed paarameters

  • kthorngrenkthorngren Posts: 21,443Questions: 26Answers: 4,974

    Those errors are coming from the server. You will need to look at logs from the server to debug the issue.

    Are you using Datatables supplied server scripts?

    Kevin

  • maniyamaniya Posts: 78Questions: 13Answers: 0

    yes i am using those, its not a problem, on my local it is working

    and even i use the script above mentioned in the link what changes i have to make to make sure this data go through as like this

    columns[0][data]    CustomerName
    columns[0][name]    [empty string]
    columns[0][orderable]   true
    columns[0][search][regex]   false
    columns[0][search][value]   [empty string]
    columns[0][searchable]
    
  • kthorngrenkthorngren Posts: 21,443Questions: 26Answers: 4,974

    The server is responding with the errors. Maybe something is incorrect with the server configuration. The client is sending the same data. You can verify this by looking at the browser's network inspector. Review the server logs to troubleshoot why its responding with 404 and 302.

    Kevin

  • maniyamaniya Posts: 78Questions: 13Answers: 0

    i did and doing it multiple times since Saturday, i am still getting the same issue

    if there is a server error why it works on local and not in dev env

  • kthorngrenkthorngren Posts: 21,443Questions: 26Answers: 4,974
    edited December 2021

    Sorry, by server I mean your web server in the dev environment. Your web server is returning the 404 and 302 responses. You need to look at the web server logs and configuration to find out why.

    Kevin

  • maniyamaniya Posts: 78Questions: 13Answers: 0

    web server logs just show 302, how can i find the details

  • kthorngrenkthorngren Posts: 21,443Questions: 26Answers: 4,974
    Answer ✓

    Depends on the web server you are using. Look for a troubleshooting guide for the web server you have. Maybe Stack Overflow will have some threads for the web server you have.

    Kevin

  • maniyamaniya Posts: 78Questions: 13Answers: 0

    its IIS and certificates are matching and i wonder why on local working

  • maniyamaniya Posts: 78Questions: 13Answers: 0

    but if i had to modify the get request and send only 1 parameter at a time, it might work

Sign In or Register to comment.