Я не смог остановить событие onClick
? Если я просто использую dom dom с событием onclick
, тогда dojo.stopEvent()
работает, но не свиджетом. Я получаю сообщение об ошибке «Не удается загрузить страницу ... статус 0». Я узнал, что это происходит, когда страница обновляется, пока выполняется вызов Ajax. Я отправляю свой код. любая помощьDojo: Не удалось остановить событие «onClick» dijit
// create a button which will be replaced by the Button widget
var submitButton = dojo.create('button', {type:"submit", id:"submitButton"}, popupFormControlDiv);
var popupFormSubmitButton = new dijit.form.Button({label: "Create", type:"submit"}, "submitButton");
dojo.connect(popupFormSubmitButton, "onClick", function(event) {
//Stop the submit event since we want to control form submission.
event.preventDefault();
event.stopPropagation();
dojo.stopEvent(event);
// construct the arguments for the post request
var xhrArgs = {
form: popupForm,
url: "/admin/sys-config/registration-form/add",
handleAs: "text",
load: function(data) {
console.log("success");
},
error: function(error) {
console.log("error");
}
}
var deferred = dojo.xhrPost(xhrArgs);
});
спасибо ..... я даже пытался его без какого-либо успеха .... страница сразу начинает обновлять один раз пост Ajax делается – rahul