0

Good morning mates, I am trying to pass some values to a view in Django.

I have a table (Datatables) with n values (id, name, lastname, etc), and I'd like to select some values and pass them (just the id) to the view and process it later. I can select multiple values and it works properly:

$('#btnSelectedRows').on('click', function() {
          var tblData = table.rows('.selected').data();
          var tmpData;
          $.each(tblData, function(i, val) {
            tmpData = tblData[i];
            alert(tmpData);
          });
        })

The problem comes when I try to "tell" the view what values I want to process, I don't know how to send this values to the view.

Thanks a lot

1 Answer 1

1

You have to send ajax request to your view_func and process the response on client-side. example here

Sign up to request clarification or add additional context in comments.

2 Comments

Yes, you do. Json is almost standard way for send information via ajax or api in web.
Thank you very much mate

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.