public static bool AsyncSubmit(jQueryObject form, Func <bool> validateBeforeSave, Action submitHandler) { var validator = form.As <jQueryValidationObject>().Validate(); dynamic valSettings = validator.As <dynamic>().settings; if (valSettings.abortHandler != null) { return(false); } if (validateBeforeSave != null && validateBeforeSave() == false) { return(false); } valSettings["abortHandler"] = new Action <jQueryValidator>(Q.Externals.ValidatorAbortHandler); valSettings["submitHandler"] = new Func <bool>(delegate() { if (submitHandler != null) { submitHandler(); } return(false); }); form.Trigger("submit"); return(true); }
public static bool Submit(jQueryObject form, Func <bool> validateBeforeSave, Action submitHandler) { var validator = form.As <jQueryValidationObject>().Validate(); dynamic valSettings = validator.As <dynamic>().settings; if (valSettings.abortHandler != null) { return(false); } if (validateBeforeSave != null && validateBeforeSave() == false) { return(false); } if (!validator.ValidateForm()) { return(false); } if (submitHandler != null) { submitHandler(); } return(true); }
public static object GetWidget(this jQueryObject element, Type widgetType) { if (element == null) { throw new ArgumentNullException("element"); } if (element.Length == 0) { throw new Exception(String.Format("Searching for widget of type '{0}' on a non-existent element! ({1})", widgetType.FullName, element.Selector)); } var widget = element.As <dynamic>().tryGetWidget(widgetType); if (widget == null) { var message = String.Format("Element has no widget of type '{0}'! If you have recently changed editor type of a property in " + "a form class, or changed data type in row (which also changes editor type) your script side Form definition might be out of date. " + "Make sure your project builds successfully and transform T4 templates", widgetType.FullName); Q.NotifyError(message); throw new Exception(message); } return(widget); }
public static void ColorBox(jQueryObject link, dynamic options) { link.As <dynamic>().colorbox(new { current = "resim {current} / {total}", previous = "önceki", next = "sonraki", close = "kapat" }); }
public static void ColorBox(jQueryObject link, dynamic options) { link.As <dynamic>().colorbox(new { current = Q.Text("Controls.ImageUpload.ColorboxCurrent"), previous = Q.Text("Controls.ImageUpload.ColorboxPrior"), next = Q.Text("Controls.ImageUpload.ColorboxNext"), close = Q.Text("Controls.ImageUpload.ColorboxClose") }); }
public static jQueryObject DialogMaximizable(this jQueryObject dialog) { dialog.As <dynamic>().dialogExtend(new { closable = true, maximizable = true, dblclick = "maximize", icons = new { maximize = "ui-icon-maximize-window" } }); return(dialog); }
public static bool Submit(jQueryObject form, Func<bool> validateBeforeSave, Action submitHandler) { var validator = form.As<jQueryValidationObject>().Validate(); dynamic valSettings = validator.As<dynamic>().settings; if (valSettings.abortHandler != null) return false; if (validateBeforeSave != null && validateBeforeSave() == false) return false; if (!validator.ValidateForm()) return false; if (submitHandler != null) submitHandler(); return true; }
public static bool AsyncSubmit(jQueryObject form, Func<bool> validateBeforeSave, Action submitHandler) { var validator = form.As<jQueryValidationObject>().Validate(); dynamic valSettings = validator.As<dynamic>().settings; if (valSettings.abortHandler != null) return false; if (validateBeforeSave != null && validateBeforeSave() == false) return false; valSettings["abortHandler"] = new Action<jQueryValidator>(Q.Externals.ValidatorAbortHandler); valSettings["submitHandler"] = new Func<bool>(delegate() { if (submitHandler != null) submitHandler(); return false; }); form.Trigger("submit"); return true; }
public static void ColorBox(jQueryObject link, dynamic options) { link.As<dynamic>().colorbox(new { current = "resim {current} / {total}", previous = "önceki", next = "sonraki", close = "kapat" }); }
public static void ColorBox(jQueryObject link, dynamic options) { link.As<dynamic>().colorbox(new { current = Q.Text("Controls.ImageUpload.ColorboxCurrent"), previous = Q.Text("Controls.ImageUpload.ColorboxPrior"), next = Q.Text("Controls.ImageUpload.ColorboxNext"), close = Q.Text("Controls.ImageUpload.ColorboxClose") }); }