Open wlambrechts2 opened 6 years ago
Here is a snippet of my code.
functions is for editing models, but you can see the code to set the data
$("#{{$id}}").alpaca().setValue(data);
setValue is what your looking for.
jQuery.fn.extend({
editModel: function (id) {
$.ajax({
type: "GET",
url: "{{ $dataRoute }}/" + id,
success: function(data) {
lastAlpacaJson = data;
lastAlpacaModelID = id;
$("#{{$id}}").alpaca().setValue(data);
$("#{{$id}}-modal").modal('show');
},
error: function(XMLHttpRequest, textStatus, errorThrown) {
swal('Error', XMLHttpRequest.responseJSON.message ,'error');
},
});
}
});
Thanks !
let me know if you need anymore help.
I made some jquery to be able to load more remote data, and postRender functions.
Hi,
Just started with Alpaca. Seems great but I can't seem to manage to change the data in Jquery. I only succeed in assigning a variable to the data and then change the value of the data variable and destroy and recreating the Alpaca form (which causes flickering).
I found the answer to this question: https://github.com/gitana/alpaca/issues/508 but the answer does not seem to work. It just does nothing.
Thanks