我在我的Java EE项目中使用了dhtmlxgantt,我下载了java连接器,我从这个链接Java Connector for dhtmlxGantt复制了这个例子,mix()
和enable_order()
被JsonGanttConnector
忽略了.Thanks。
Test_conector.java
import com.dhtmlx.connector.DBType;
import com.dhtmlx.connector.JSONGanttConnector;
import java.sql.Connection;
import java.sql.DriverManager;
import com.dhtmlx.connector.*;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
public class Test_conector extends ThreadSafeConnectorServlet {
@Override
protected void configure(HttpServletRequest req, HttpServletResponse res) {
Connection conn=null;
try {
Class.forName ("com.mysql.jdbc.Driver").newInstance ();
conn = DriverManager.getConnection("jdbc:mysql://localhost/parc","root","");
} catch (Throwable e) {
e.printStackTrace();
}
JSONGanttConnector gantt = new JSONGanttConnector(conn, DBType.MySQL);
gantt.servlet(req, res);
gantt.mix("open", "1");
gantt.enable_order("sortorder");
gantt.render_links("gantt_links", "id", "source,target,type");
gantt.render_table("gantts", "id","text", "start_date,duration,progress,sortorder,parent");
}
}
答案 0 :(得分:0)
.mix和.enable_order API仅适用于PHP版本的连接器。
您可以使用beforeRender行为为数据对象定义open
属性。就我所见,enable_order
API没有其他选择。