Why my grails checkbox onclick remote function ajax call displays updates wrong?
By : Dan Perks
Date : March 29 2020, 07:55 AM
I think the issue was by ths following , Hi, I have a page called taskReminder that renders two templates: 1 for task and 1 for reminder. The task has checkbox that when ticked, it should repopulate/update the tasklist. Everything is working fine but what I can't seem to understand is why task frame updates and displays the whole page inside it. In summary: The whole page has a task frame in which it also displays the whole page inside it.(like inception!) I redesigned the html, re-evaluated my remotefunction, I also tried putting a diff checkbox inside the reminder frame - when ticked, it updates reminderlist that is inside the task frame with the whole page in it, not his own frame list. , Edit your controller: code :
render(view: "taskReminder", model: [taskInstanceList: taskInstanceList, taskInstanceTotal: taskCount, reminderList: reminders, reminderListTotal: reminderCount, cmCaseInstance:cmCaseInstance])
if(request.xhr){
render(template: '/***templatePath***/task.gsp', model: [taskInstanceList: taskInstanceList, taskInstanceTotal: taskCount, reminderList: reminders, reminderListTotal: reminderCount, cmCaseInstance:cmCaseInstance])
return
}
render(view: "taskReminder", model: [taskInstanceList: taskInstanceList, taskInstanceTotal: taskCount, reminderList: reminders, reminderListTotal: reminderCount, cmCaseInstance:cmCaseInstance])
|
onclick checkbox + ajax cache html
By : keyurpatel
Date : March 29 2020, 07:55 AM
I think the issue was by ths following , Depending on what version of jQuery you are using, the onclick event will fire and process before the value of the checkbox has actually changed. I would suggest using an onchange event instead of onclick, as this will ensure that the event will not run until after the checkbox has checked or unchecked. Additionally, $.html() will not return the status of the checkbox. The actual html in the DOM does not get altered whenever you check the box; the checked status is stored as a property on the input, as opposed to an attributed. You'll need to manually check the checked status of each checkbox and send that information to your .php page. See example Fiddle here. code :
var checkedStatus = []; // send this array to your php
$(':input', '#list').each(function () {
checkedStatus.push($(this).prop('checked'));
});
|
Call value onclick checkbox Javascript
By : Юрий Скасырский
Date : March 29 2020, 07:55 AM
will help you By lack of classes or IDs, you can use the querySelector to get the appropriate elements: code :
var cb = document.querySelector('input[type="checkbox"]');
var td = document.querySelector("td[contenteditable]";
cb.addEventListener("click", function(){
td.className = td.className + " crossed";
});
|
How to call ajax function for each checkbox based on the checkbox state?
By : Rajeev Kumar
Date : March 29 2020, 07:55 AM
like below fixes the issue I have tested your code here: example You can display only one alert box at time. You should gather all messages. code :
.promise().done(function() {
location.reload();
});
|
how to make other ajax calls after one ajax call completes and second ajax call should not call the .stop function
By : raj parekh
Date : March 29 2020, 07:55 AM
Hope that helps actually i 'm calling multiple ajax calls but i want some ajax calls completes first and exectute the atsk defined in its stop function.but some ajax call should be made once function defined in stop method executes and those ajax call should not cal.stop method once again , I think you want to set:
|