Package org.sgx.yuigwt.yui.util

Examples of org.sgx.yuigwt.yui.util.JsObject


    public JsArray<JavaScriptObject> getDataTableData(Collection<T> l) {
      JsArray<JavaScriptObject> a = JsArray.createArray().cast();
      int i = 0;
      for (T t : l) {
        JsObject jso = jsonizer.jsonize(t).cast();
        jso.objPut("___id", i);
        a.push(jso);
        i++;
      }
      return a;
    }
View Full Code Here


  final StringBuffer sb = new StringBuffer();
  ml.each(new ArrayListCallback<JavaScriptObject>() {
    @Override
    public boolean call(JavaScriptObject item_, int index) {
      Attribute item = item_.cast()
      JsObject data = item.getAttrs(new String[]{"select", "port", "pname"});
      String s = "";
      if(data.objGetBoolean("select")) {
       
        data.objPut("index", index);
        sb.append(Y.Lang().sub(template, data));
      }
      return false;
    }
  });
View Full Code Here

  ModelList ml = table1.dataModelList();
  ml.each(new ArrayListCallback<JavaScriptObject>() {
    @Override
    public boolean call(JavaScriptObject item_, int index) {//     
      Attribute item = item_.cast()
      JsObject data = item.getAttrs(new String[]{"select", "port", "pname"});
      if(data.objGetBoolean("select")) { 
        table1.removeRow(index);
      }
      return false;
    }
  });
View Full Code Here

public void test(final Node parent) {
YUI.Use(new String[]{"charts-legend"}, new YUICallback() {
  @Override
  public void ready(final YuiContext Y) {
    //use a table to position charts.
    JsObject axes = JsObject.one("percentage", AxisConfig.create().axisType("numeric"));
   
  }
});
}
View Full Code Here

    
    //a general legend configuration to use in all our charts.
    ChartLegendConfig legendConfig1 = ChartLegendConfig.create();
   
    //use a table to position charts.
    JsObject axes = JsObject.one("percentage", AxisConfig.create().axisType("numeric"));
    CartesianChartConfig chartConfig = CartesianChartConfig.create().cast();
    chartConfig.categoryKey("date");
    chartConfig.dataProvider(data1);
    chartConfig.render("#chart1");
    chartConfig.legend(legendConfig1);
View Full Code Here


protected JsArray<JavaScriptObject> data1() {
  JsArray<JavaScriptObject> a = JavaScriptObject.createArray().cast();
  for (int i = 0; i < 40; i++) {
    JsObject o = JavaScriptObject.createObject().cast();
    o.objPut("name", testUtil.randomLetters(testUtil.randomBetween(10, 20)));
    o.objPut("age", testUtil.randomBetween(10, 20));
    a.push(o);
  }
  return a;
}
View Full Code Here

TOP

Related Classes of org.sgx.yuigwt.yui.util.JsObject

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.