Exemplo n.º 1
0
  @Override
  public void onConfigure(JQueryBehavior behavior) {
    super.onConfigure(behavior);

    StringBuilder statements = new StringBuilder();

    statements
        .append("jQuery('#")
        .append(this.lower.getMarkupId())
        .append("').val(ui.values[0]); ");
    statements
        .append("jQuery('#")
        .append(this.upper.getMarkupId())
        .append("').val(ui.values[1]); ");

    if (!Strings.isEmpty(super.labelId)) {
      statements
          .append("jQuery('#")
          .append(super.labelId)
          .append("').text(")
          .append(this.getLabelPattern())
          .append("); ");
    }

    behavior.setOption("slide", String.format("function(event, ui) { %s }", statements));
    behavior.setOption("values", this.getModelObject());
  }
Exemplo n.º 2
0
 @Override
 public void onConfigure(JQueryBehavior behavior) {
   if (behavior.getOption("format") == null) {
     behavior.setOption(
         "format", Options.asString(KendoDateTimeUtils.toPattern(this.getTextFormat())));
   }
 }
 @Override
 public void onConfigure(JQueryBehavior behavior) {
   // class options //
   behavior.setOption("autoOpen", false);
   behavior.setOption("title", Options.asString(this.title.getObject()));
   behavior.setOption("modal", this.isModal());
   behavior.setOption("resizable", this.isResizable());
   behavior.setOption("width", this.getWidth());
 }
  // Events //
  @Override
  public void onConfigure(Component component) {
    super.onConfigure(component);

    this.setOption("value", component.getDefaultModelObjectAsString()); // initial value
    this.setOption("change", this.onChangeBehavior.getCallbackFunction());
  }
Exemplo n.º 5
0
  @Override
  public void onConfigure(JQueryBehavior behavior) {
    behavior.setOption("dataTextField", Options.asString(this.renderer.getTextField()));
    behavior.setOption("dataValueField", Options.asString(this.renderer.getValueField()));

    // set template (if any) //
    if (this.templateBehavior != null) {
      behavior.setOption(
          "template", String.format("jQuery('#%s').html()", this.getTemplateToken()));
      // TODO replace with kendo.template(jQuery('#%s').html()) - everywhere
    }

    // set list-width //
    if (this.getListWidth() > 0) {
      behavior.setOption(
          "open", String.format("function(e) { e.sender.list.width(%d); }", this.getListWidth()));
    }
  }
 /**
  * Gets the jQuery statement.<br>
  * <b>Warning: </b> This method is *not* called by the behavior directly (only {@link #$()} is).
  *
  * @param options the options to be supplied to the current method
  * @return the jQuery statement
  */
 public String $(String options) {
   return JQueryBehavior.$(this.selector, this.method, options);
 }
 @Override
 protected String $() {
   return JQueryBehavior.$(this.selector, this.method, this.options.toString());
 }
 @Override
 public void onConfigure(JQueryBehavior behavior) {
   behavior.setOption("source", Options.asString(this.sourceBehavior.getCallbackUrl()));
 }
  // Methods //
  @Override
  public void bind(Component component) {
    super.bind(component);

    component.add(this.onChangeBehavior = this.newOnChangeBehavior());
  }