I am using JQuery to create dynamic rows to my table in JSP file. I can able to create and assign value to it. But I need a help at the time of deleting the rows. When I delete the last row, it is not a problem . But if I delete an intermediate row, and try to add new row, the value is not getting. Please help me to find a solution for it.
In my application, I have two text boxes and I want to select values using autocomplete. I want to display the autocomplete details based on the data selected on the previous value. and in that field also, I am using autocomplete.
In the first case, I am selecting all the possible groups from DB as JSON object and set it to request and get it from request on my JSP file.
Why I am doing like this is, I am not getting the full string from hidden variable. So, I converted the double cords to single and set it in the hidden variable and taking it in the JQuery.
Then I am replacing all the single cords to double and convert it to JSON array.
$("#grpCodeLbl").autocomplete({
source: aGrps,
select: function(event, ui) {
event.preventDefault();
var grpCd = ui.item.value;
$("#grpCodeLbl").val(ui.item.label);
$('#GroupCode').val(ui.item.value);
$("#mainDesigLabel").attr('disabled', false);
populateMainDesigs();
//return false;
},
change: function(event, ui){
$('#mainDesigLabel').val("");
$('#MainDesigCode').val("");
}
});
This is the method used to display autocomplete details on the first text box. In this, I wrote one custom method to take values from DB and set it as a string using AJAX to avoid DB fetching each time.
In my application, I have two text boxes and I want to select values using autocomplete. I want to display the autocomplete details based on the data selected on the previous value. and in that field also, I am using autocomplete.
$("#grpCodeLbl").autocomplete({
source: aGrps,
select: function(event, ui) {
event.preventDefault();
var grpCd = ui.item.value;
$("#grpCodeLbl").val(ui.item.label);
$('#GroupCode').val(ui.item.value);
$("#mainDesigLabel").attr('disabled', false);
populateMainDesigs();
//return false;
},
change: function(event, ui){
$('#mainDesigLabel').val("");
$('#MainDesigCode').val("");
}
});
This is the method used to display autocomplete details on the first text box. In this, I wrote one custom method to take values from DB and set it as a string using AJAX to avoid DB fetching each time.
I am trying to include autocomplete option in my application and I want to get this while loading the page without any AJAX call. So, I am collecting all the details from DB and set it as a JSON string and passing it to my JSP.
In my JSP file, I am trying to get the values directly from that JSON string. But I am not getting the autocomplete option in my text box.