I have a view where there is a dropdown and datatable.
At initial load, I am loading the values to be loaded in the datatable based on the first select of dropdown and on change of dropdown, I want to fetch data based on that condition and populate those data on the datatable.
Please anyone suggest a way to do this!
I am trying a way using get request but it is reloading the page and hence I am unable to make the data persist in the datatable.
I followed exactly this https://laracasts.com/discuss/channels/laravel/filtering-data-using-drop-down-onchange-event
Data is coming and populates to the datatable but just after a second, it reloads and comes to old data in datatable.
Please either correct my or suggest some new way to do it!
After debugging, I found that in one of the js file included, there were a code
$(document).ajaxStop(function() {
window.location.reload();
});
Since, this code was making it to reload on every ajax call completes, I faced this issue.
Related
I have a data table that represents data like this:
after clicking the edit marker (pencil icon) i can edit some fields. The fields need to be validated and if it fails the fields have to reset. I do this in the managed bean of the view using p:ajax event="rowEditInit" to save the attributes before saving and ajax event="rowEdit"to do the actual validation. if validation fails i return the previously saved values. if validation is correct i save the data to the database and load the collection again. Then i
RequestContext.getCurrentInstance().update("vesselBalticSegmentCreateForm")
to reload the view.
Doesnt matter if the validation fails and i set the values back or it succeeds and i save/reload data the table breaks becoming like this:
seems to load only the edited row. and loads both edit/list modes.
any ideas what i'm doing wrong?
The primeFaces RowEdit functionality already updates the row, also updating the table does by design not work (not sure if it is intentional, but that is just how it is). I know there is a duplicate of this Q/A on stackoverflow, I just do not seem to be able to find it. Someone might be able to create a patch/workaround, e.g. try on the prerenderview event to remove the id's of id's in the individual row that was edited. I don't have the time to try to create one.
I have read many posts that talks about this but still I cannot find a clear answer to my question
I need to reload only 1 row when I click on a button
At the moment, I send an ajax request to the server that change a boolean value. The request change the db field but not the table obviously. Now I need to refresh the corresponding table field which is row specific.
$('#table').DataTable().ajax.reload();
This works but it is not quick enough
How can I refresh only the row where the modification happens. Even better if I can refresh only the specific field within the row
Something like this:
$('#table').DataTable().row(rowNumber).data();
I have read that I need to send an ajax request that give me the updated value and put it in the field. I know already what to put but how can I refresh the specific field?
Can you please show me an example
I am using dandelion datatables 1.1.0
I am using Jquery data table plugin. I was able to display it properly with filtering, sorting and Paging.
But, now the problem is i need to filter the data table rows based on dropdown selection made.
but, i do not have any idea how to do this..I am very new to MVC. So, here i need to send that dropdown selected item as parameter to a server side method and call a method and rebind data to the data table.
I am initially binding data to the data table using for loop and iterating over a datatable
Do i need to use Ajax here..if so how to get the new datatable/data to this view and bind to data table?
Please suggest the way to do..
you use the jquery datatable for this
create function and paste jquery datatable code in there
then call this function on dropdown selection change using jquery.
Tips :jquery datatable code available on net find and use it
I'm having real trouble finding any documentation on this.
I have a page that displays a list of users, above this i can edit the users successfuly with ajax. After the update, i want the table below to be updated with the new information.
How do i go about doing this? I'm thinking i need some sort of view that displays the data in a table, and i want to get that view's contents and inject it into my page, but i can't seem to find out how?
Can anyone point me in the right direction please
Put users table in div id like "Users" and do something like following in edit ajax success function call
$("#users").load("same_page_url #users");
I use primefaces and the dataTable component. On my Site i have several forms which i use to collect Data and persist it in the Database. This is triggered by a p:command Button, which Attribute “Update“ contains the id of the dataTable showing the DB contents. When i submit the Form the component (table) is Not updated. What could be wrong?
not an answer but a question to help divine the point of failure. is the datatable in a separate form from the commandButton? if so, assuming you're using ajax="true" (the default for pf components), how are you referencing the table to make sure it updates. if you're not using ajax, i'm guessing it's a stale data issue in the backing bean. but without more info, it's hard. try attaching source code (stripped down to your comfort level if you're working on something sensitive).
HTH