50 |
How do I get the start/end of the bar once the BarResize/BarResizing event occurs
<BODY onload="Init()"> <SCRIPT FOR="G2Host1" EVENT="HostEvent(EventID)" LANGUAGE="JScript"> var h = G2Host1.HostEventParam(0); var key = G2Host1.HostEventParam(1); alert( G2Host1.HostEventParam(-2) ); alert( "Start:" ); alert( G2Host1.Host.Items.ItemBar(h,key,1) ); alert( G2Host1.HostEventParam(-2) ); alert( "End:" ); alert( G2Host1.Host.Items.ItemBar(h,key,2) ); </SCRIPT> <OBJECT CLASSID="clsid:DFE195F7-4F43-482A-A14B-0C97B032A5E1" id="G2Host1"></OBJECT> <SCRIPT LANGUAGE="JScript"> function Init() { var var_Chart = G2Host1.Host.Chart; var_Chart.PaneWidth(false) = 128; var_Chart.FirstVisibleDate = "3/30/2019"; var var_Items = G2Host1.Host.Items; var_Items.AddBar(var_Items.AddItem("Task"),"Task","4/1/2019","4/14/2019",null,null); } </SCRIPT> </BODY> |
49 |
How do I get the bar/task from the cursor
<BODY onload="Init()"> <SCRIPT FOR="G2Host1" EVENT="HostEvent(EventID)" LANGUAGE="JScript"> alert( "Event:" ); alert( G2Host1.HostEventParam(-2) ); var var_G2antt = G2Host1.Host; var i = var_G2antt.ItemFromPoint(-1,-1,c,h); alert( "Cell:" ); alert( var_G2antt.Items.CellCaption(i,c) ); var var_Chart = var_G2antt.Chart; var b = var_Chart.BarFromPoint(-1,1); alert( "Bar:" ); alert( G2Host1.Host.Items.ItemBar(i,b,0) ); </SCRIPT> <OBJECT CLASSID="clsid:DFE195F7-4F43-482A-A14B-0C97B032A5E1" id="G2Host1"></OBJECT> <SCRIPT LANGUAGE="JScript"> function Init() { } </SCRIPT> </BODY> |
48 |
How do I get the cell from the cursor
<BODY onload="Init()"> <SCRIPT FOR="G2Host1" EVENT="HostEvent(EventID)" LANGUAGE="JScript"> alert( "Event:" ); alert( G2Host1.HostEventParam(-2) ); var var_G2antt = G2Host1.Host; var i = var_G2antt.ItemFromPoint(-1,-1,c,h); alert( "Cell:" ); alert( var_G2antt.Items.CellCaption(i,c) ); </SCRIPT> <OBJECT CLASSID="clsid:DFE195F7-4F43-482A-A14B-0C97B032A5E1" id="G2Host1"></OBJECT> <SCRIPT LANGUAGE="JScript"> function Init() { } </SCRIPT> </BODY> |
47 |
How can I highlights cells based on its value
<BODY onload="Init()"> <OBJECT CLASSID="clsid:DFE195F7-4F43-482A-A14B-0C97B032A5E1" id="G2Host1"></OBJECT> <SCRIPT LANGUAGE="JScript"> function Init() { G2Host1.DataSource("Items") = "C:\\Program Files\\Exontrol\\ExG2Host\\Sample\\sample.accdb"; G2Host1.DataMember("Items") = "Employees"; G2Host1.DataField(0) = "Items"; G2Host1.DataField(1) = "EmployeeID"; G2Host1.DataField(2) = "ReportsTo"; G2Host1.DataSource("Tasks") = G2Host1.DataSource("Items"); G2Host1.DataMember("Tasks") = "EmployeeDetails"; G2Host1.DataField(7) = "Tasks"; G2Host1.DataField(8) = "EmployeeID"; G2Host1.DataField(9) = "DateStart"; G2Host1.DataField(10) = "DateEnd"; G2Host1.DataField(14) = "TaskID"; G2Host1.DataField(12) = "Color"; G2Host1.DataField(13) = "TaskName"; var var_G2antt = G2Host1.Host; var_G2antt.BeginUpdate(); var_G2antt.BackColorAlternate = 0; var var_Column = var_G2antt.Columns.Item("Title"); var_Column.Def(4) = 15790320; var_Column.Width = var_Column.AutoWidth; var var_ConditionalFormats = var_G2antt.ConditionalFormats; var_ConditionalFormats.Add("lower(%4) contains `manager`",null).Bold = true; var_ConditionalFormats.Add("%3",null).BackColor = 15790320; var_G2antt.Items.ExpandItem(0) = true; var var_Column1 = var_G2antt.Columns.Item("EmployeeID"); var_Column1.Width = var_Column1.AutoWidth; var_G2antt.EndUpdate(); } </SCRIPT> </BODY> |
46 |
How do I programatically hide a column
<BODY onload="Init()"> <OBJECT CLASSID="clsid:DFE195F7-4F43-482A-A14B-0C97B032A5E1" id="G2Host1"></OBJECT> <SCRIPT LANGUAGE="JScript"> function Init() { G2Host1.DataSource("Items") = "C:\\Program Files\\Exontrol\\ExG2Host\\Sample\\sample.accdb"; G2Host1.DataMember("Items") = "Employees"; G2Host1.DataField(0) = "Items"; G2Host1.DataField(1) = "EmployeeID"; G2Host1.DataField(2) = "ReportsTo"; G2Host1.DataSource("Tasks") = G2Host1.DataSource("Items"); G2Host1.DataMember("Tasks") = "EmployeeDetails"; G2Host1.DataField(7) = "Tasks"; G2Host1.DataField(8) = "EmployeeID"; G2Host1.DataField(9) = "DateStart"; G2Host1.DataField(10) = "DateEnd"; G2Host1.DataField(14) = "TaskID"; G2Host1.DataField(12) = "Color"; G2Host1.DataField(13) = "TaskName"; G2Host1.Host.Columns.Item("LastName").Visible = false; } </SCRIPT> </BODY> |
45 |
Is it possible to get the information from the control when we click on the bar/item
<BODY onload="Init()"> <SCRIPT FOR="G2Host1" EVENT="HostEvent(EventID)" LANGUAGE="JScript"> alert( G2Host1.HostEventParam(-2) ); var var_G2antt = G2Host1.Host; var i = var_G2antt.ItemFromPoint(-1,-1,c,hit); alert( "cell's value from cursor: " ); alert( var_G2antt.Items.CellValue(i,c) ); alert( "cell's value on col 1: " ); alert( var_G2antt.Items.CellValue(i,1) ); var b = var_G2antt.Chart.BarFromPoint(-1,-1); alert( "Bar:" ); alert( b ); alert( "Bar Start:" ); alert( var_G2antt.Items.ItemBar(i,b,1) ); alert( "Bar End:" ); alert( var_G2antt.Items.ItemBar(i,b,2) ); alert( "Bar Caption:" ); alert( var_G2antt.Items.ItemBar(i,b,3) ); </SCRIPT> <OBJECT CLASSID="clsid:DFE195F7-4F43-482A-A14B-0C97B032A5E1" id="G2Host1"></OBJECT> <SCRIPT LANGUAGE="JScript"> function Init() { var var_G2antt = G2Host1.Host; var_G2antt.Debug = true; var var_Bar = var_G2antt.Chart.Bars.Item("Task"); var_Bar.OverlaidType = 515; var_Bar.OverlaidGroup = "Task,Progress"; G2Host1.DataSource("Items") = "C:\\Program Files\\Exontrol\\ExG2Host\\Sample\\sample.accdb"; G2Host1.DataMember("Items") = "Employees"; G2Host1.DataField(0) = "Items"; G2Host1.DataField(1) = "EmployeeID"; G2Host1.DataField(2) = "ReportsTo"; G2Host1.DataSource("Tasks") = G2Host1.DataSource("Items"); G2Host1.DataMember("Tasks") = "EmployeeDetails"; G2Host1.DataField(7) = "Tasks"; G2Host1.DataField(8) = "EmployeeID"; G2Host1.DataField(9) = "DateStart"; G2Host1.DataField(10) = "DateEnd"; G2Host1.DataField(14) = "TaskID"; G2Host1.DataField(12) = "Color"; G2Host1.DataField(13) = "TaskName"; G2Host1.Host.Items.ExpandItem(0) = true; var var_Chart = G2Host1.Host.Chart; var_Chart.PaneWidth(false) = 128; var_Chart.ScrollTo("5/27/2017",1); } </SCRIPT> </BODY> |
44 |
How do I get the bar from the cursor
<BODY onload="Init()"> <SCRIPT FOR="G2Host1" EVENT="HostEvent(EventID)" LANGUAGE="JScript"> alert( G2Host1.HostEventParam(-2) ); alert( G2Host1.Host.Chart.BarFromPoint(-1,-1) ); </SCRIPT> <OBJECT CLASSID="clsid:DFE195F7-4F43-482A-A14B-0C97B032A5E1" id="G2Host1"></OBJECT> <SCRIPT LANGUAGE="JScript"> function Init() { var var_G2antt = G2Host1.Host; var_G2antt.VisualAppearance.Add(1,"C:\\Program Files\\Exontrol\\ExG2Host\\Sample\\EBN\\Assorted\\wbs-ass.ebn"); var var_Bar = var_G2antt.Chart.Bars.Item("Task"); var_Bar.Height = 15; var_Bar.Color = 33488896; var_Bar.OverlaidType = 515; var_Bar.OverlaidGroup = "Task,Progress"; G2Host1.DataSource("Items") = "C:\\Program Files\\Exontrol\\ExG2Host\\Sample\\sample.accdb"; G2Host1.DataMember("Items") = "Employees"; G2Host1.DataField(0) = "Items"; G2Host1.DataField(1) = "EmployeeID"; G2Host1.DataField(2) = "ReportsTo"; G2Host1.DataSource("Tasks") = G2Host1.DataSource("Items"); G2Host1.DataMember("Tasks") = "EmployeeDetails"; G2Host1.DataField(7) = "Tasks"; G2Host1.DataField(8) = "EmployeeID"; G2Host1.DataField(9) = "DateStart"; G2Host1.DataField(10) = "DateEnd"; G2Host1.DataField(14) = "TaskID"; G2Host1.DataField(12) = "Color"; G2Host1.DataField(13) = "TaskName"; G2Host1.Host.Items.ExpandItem(0) = true; var var_Chart = G2Host1.Host.Chart; var_Chart.PaneWidth(false) = 128; var_Chart.ScrollTo("5/27/2017",1); } </SCRIPT> </BODY> |
43 |
How do I add Start/End columns
<BODY onload="Init()"> <SCRIPT FOR="G2Host1" EVENT="HostEvent(EventID)" LANGUAGE="JScript"> alert( G2Host1.HostEventParam(-2) ); </SCRIPT> <OBJECT CLASSID="clsid:DFE195F7-4F43-482A-A14B-0C97B032A5E1" id="G2Host1"></OBJECT> <SCRIPT LANGUAGE="JScript"> function Init() { G2Host1.HostReadOnly = 255; var var_G2antt = G2Host1.Host; var_G2antt.SingleSel = false; var_G2antt.OnResizeControl = 1; var_G2antt.ScrollBars = 2058; var var_Column = var_G2antt.Columns.Add("Start"); var_Column.AllowSizing = false; var_Column.Def(18) = 1; var_Column.Editor.EditType = 7; var var_Column1 = var_G2antt.Columns.Add("End"); var_Column1.AllowSizing = false; var_Column1.Def(18) = 2; var_Column1.Editor.EditType = 7; var_G2antt.Items.AllowCellValueToItemBar = true; var var_Chart = var_G2antt.Chart; var_Chart.AllowCreateBar = 1; var_Chart.PaneWidth(false) = 256; var_Chart.Bars.Item("Task").OverlaidType = 515; } </SCRIPT> </BODY> |
42 |
How do I hide the left/items/columns part of the control
|
41 |
How do I hide the right/chart/tasks part of the control
|
40 |
How do hide the top/overview part of the control
|
39 |
How do I resize the panels
|
38 |
How do I lock the first column
|
37 |
How do I specify a different color for the tasks ( EBN color )
|
36 |
How do I specify a different color for the tasks ( solid color, transparent )
|
35 |
GroupBy
|
34 |
How can I hide a column
|
33 |
Can row errors being highligted until the user correct them, not to clear them as soon a change occurs
<BODY onload="Init()"> <SCRIPT FOR="G2Host1" EVENT="Error(Error,Description)" LANGUAGE="JScript"> alert( Error ); alert( Description ); </SCRIPT> <OBJECT CLASSID="clsid:DFE195F7-4F43-482A-A14B-0C97B032A5E1" id="G2Host1"></OBJECT> <SCRIPT LANGUAGE="JScript"> function Init() { G2Host1.DataSource("Items") = "C:\\Program Files\\Exontrol\\ExG2Host\\Sample\\sample.accdb"; G2Host1.DataMember("Items") = "Employees"; G2Host1.DataField(0) = "Items"; G2Host1.DataField(1) = "EmployeeID"; G2Host1.HostDef(7) = false; } </SCRIPT> </BODY> |
32 |
No error is highligthed
<BODY onload="Init()"> <SCRIPT FOR="G2Host1" EVENT="Error(Error,Description)" LANGUAGE="JScript"> alert( Error ); alert( Description ); </SCRIPT> <OBJECT CLASSID="clsid:DFE195F7-4F43-482A-A14B-0C97B032A5E1" id="G2Host1"></OBJECT> <SCRIPT LANGUAGE="JScript"> function Init() { G2Host1.DataSource("Items") = "C:\\Program Files\\Exontrol\\ExG2Host\\Sample\\sample.accdb"; G2Host1.DataMember("Items") = "Employees"; G2Host1.DataField(0) = "Items"; G2Host1.DataField(1) = "EmployeeID"; } </SCRIPT> </BODY> |
31 |
I've noticed that rows with errors are shown in red. Is it possible to change the colors
<BODY onload="Init()"> <SCRIPT FOR="G2Host1" EVENT="Error(Error,Description)" LANGUAGE="JScript"> alert( Error ); alert( Description ); </SCRIPT> <OBJECT CLASSID="clsid:DFE195F7-4F43-482A-A14B-0C97B032A5E1" id="G2Host1"></OBJECT> <SCRIPT LANGUAGE="JScript"> function Init() { G2Host1.DataSource("Items") = "C:\\Program Files\\Exontrol\\ExG2Host\\Sample\\sample.accdb"; G2Host1.DataMember("Items") = "Employees"; G2Host1.DataField(0) = "Items"; G2Host1.DataField(1) = "EmployeeID"; G2Host1.HostDef(6) = 0; G2Host1.HostDef(5) = 16777215; } </SCRIPT> </BODY> |
30 |
Is it possible to rename the (New) to something else
|
29 |
How can I hide the (New) item (sample 2)
|
28 |
How can I hide the (New) item (sample 1)
|
27 |
Read-Only
<BODY onload="Init()"> <SCRIPT FOR="G2Host1" EVENT="Error(Error,Description)" LANGUAGE="JScript"> alert( Error ); alert( Description ); </SCRIPT> <OBJECT CLASSID="clsid:DFE195F7-4F43-482A-A14B-0C97B032A5E1" id="G2Host1"></OBJECT> <SCRIPT LANGUAGE="JScript"> function Init() { G2Host1.DataSource("Items") = "C:\\Program Files\\Exontrol\\ExG2Host\\Sample\\sample.accdb"; G2Host1.DataMember("Items") = "Employees"; G2Host1.DataField(0) = "Items"; G2Host1.HostReadOnly = 0; } </SCRIPT> </BODY> |
26 |
How can I prevent user create new /delete tasks ( only move or resize then )
<BODY onload="Init()"> <SCRIPT FOR="G2Host1" EVENT="Error(Error,Description)" LANGUAGE="JScript"> alert( Error ); alert( Description ); </SCRIPT> <OBJECT CLASSID="clsid:DFE195F7-4F43-482A-A14B-0C97B032A5E1" id="G2Host1"></OBJECT> <SCRIPT LANGUAGE="JScript"> function Init() { G2Host1.DataSource("Items") = "C:\\Program Files\\Exontrol\\ExG2Host\\Sample\\sample.accdb"; G2Host1.DataMember("Items") = "Employees"; G2Host1.DataField(0) = "Items"; G2Host1.DataField(1) = "EmployeeID"; G2Host1.DataSource("Tasks") = G2Host1.DataSource("Items"); G2Host1.DataMember("Tasks") = "EmployeeDetails"; G2Host1.DataField(7) = "Tasks"; G2Host1.DataField(8) = "EmployeeID"; G2Host1.DataField(9) = "DateStart"; G2Host1.DataField(10) = "DateEnd"; G2Host1.DataField(14) = "TaskID"; G2Host1.DataSource("Links") = G2Host1.DataSource("Items"); G2Host1.DataMember("Links") = "EmployeeLinks"; G2Host1.DataField(15) = "Links"; G2Host1.DataField(16) = "Start"; G2Host1.DataField(17) = "End"; var var_Bar = G2Host1.Host.Chart.Bars.Item("Task"); var_Bar.OverlaidType = 515; var_Bar.OverlaidGroup = "Task,Progress"; G2Host1.Host.Items.ExpandItem(0) = true; G2Host1.HostReadOnly = 128; G2Host1.Host.Chart.ScrollTo("5/27/2017",1); } </SCRIPT> </BODY> |
25 |
How do I get the row/item/task/link from the cursor
<BODY onload="Init()"> <SCRIPT FOR="G2Host1" EVENT="Error(Error,Description)" LANGUAGE="JScript"> alert( Error ); alert( Description ); </SCRIPT> <SCRIPT FOR="G2Host1" EVENT="HostEvent(EventID)" LANGUAGE="JScript"> alert( G2Host1.HostContext.ToString ); </SCRIPT> <OBJECT CLASSID="clsid:DFE195F7-4F43-482A-A14B-0C97B032A5E1" id="G2Host1"></OBJECT> <SCRIPT LANGUAGE="JScript"> function Init() { G2Host1.DataSource("Items") = "C:\\Program Files\\Exontrol\\ExG2Host\\Sample\\sample.accdb"; G2Host1.DataMember("Items") = "Employees"; G2Host1.DataField(0) = "Items"; G2Host1.HostReadOnly = 141; } </SCRIPT> </BODY> |
24 |
Disable Delete
<BODY onload="Init()"> <SCRIPT FOR="G2Host1" EVENT="Error(Error,Description)" LANGUAGE="JScript"> alert( Error ); alert( Description ); </SCRIPT> <OBJECT CLASSID="clsid:DFE195F7-4F43-482A-A14B-0C97B032A5E1" id="G2Host1"></OBJECT> <SCRIPT LANGUAGE="JScript"> function Init() { G2Host1.DataSource("Items") = "C:\\Program Files\\Exontrol\\ExG2Host\\Sample\\sample.accdb"; G2Host1.DataMember("Items") = "Employees"; G2Host1.DataField(0) = "Items"; G2Host1.HostReadOnly = 141; } </SCRIPT> </BODY> |
23 |
Disable AddNew
<BODY onload="Init()"> <SCRIPT FOR="G2Host1" EVENT="Error(Error,Description)" LANGUAGE="JScript"> alert( Error ); alert( Description ); </SCRIPT> <OBJECT CLASSID="clsid:DFE195F7-4F43-482A-A14B-0C97B032A5E1" id="G2Host1"></OBJECT> <SCRIPT LANGUAGE="JScript"> function Init() { G2Host1.DataSource("Items") = "C:\\Program Files\\Exontrol\\ExG2Host\\Sample\\sample.accdb"; G2Host1.DataMember("Items") = "Employees"; G2Host1.DataField(0) = "Items"; G2Host1.HostReadOnly = 240; } </SCRIPT> </BODY> |
22 |
ACCDB sample ( file )
<BODY onload="Init()"> <SCRIPT FOR="G2Host1" EVENT="Error(Error,Description)" LANGUAGE="JScript"> alert( Error ); alert( Description ); </SCRIPT> <OBJECT CLASSID="clsid:DFE195F7-4F43-482A-A14B-0C97B032A5E1" id="G2Host1"></OBJECT> <SCRIPT LANGUAGE="JScript"> function Init() { G2Host1.DataSource("Items") = "C:\\Program Files\\Exontrol\\ExG2Host\\Sample\\sample.accdb"; G2Host1.DataMember("Items") = "Employees"; G2Host1.DataField(0) = "Items"; G2Host1.DataField(1) = "EmployeeID"; G2Host1.DataField(2) = "ReportsTo"; G2Host1.DataSource("Tasks") = G2Host1.DataSource("Items"); G2Host1.DataMember("Tasks") = "EmployeeDetails"; G2Host1.DataField(7) = "Tasks"; G2Host1.DataField(8) = "EmployeeID"; G2Host1.DataField(9) = "DateStart"; G2Host1.DataField(10) = "DateEnd"; G2Host1.DataField(14) = "TaskID"; G2Host1.DataSource("Links") = G2Host1.DataSource("Items"); G2Host1.DataMember("Links") = "EmployeeLinks"; G2Host1.DataField(15) = "Links"; G2Host1.DataField(16) = "Start"; G2Host1.DataField(17) = "End"; var var_Bar = G2Host1.Host.Chart.Bars.Item("Task"); var_Bar.OverlaidType = 515; var_Bar.OverlaidGroup = "Task,Progress"; G2Host1.Host.Items.ExpandItem(0) = true; G2Host1.Host.Chart.ScrollTo("5/27/2017",1); } </SCRIPT> </BODY> |
21 |
MDB sample ( file )
<BODY onload="Init()"> <SCRIPT FOR="G2Host1" EVENT="Error(Error,Description)" LANGUAGE="JScript"> alert( Error ); alert( Description ); </SCRIPT> <OBJECT CLASSID="clsid:DFE195F7-4F43-482A-A14B-0C97B032A5E1" id="G2Host1"></OBJECT> <SCRIPT LANGUAGE="JScript"> function Init() { G2Host1.DataSource("Items") = "C:\\Program Files\\Exontrol\\ExG2Host\\Sample\\sample.mdb"; G2Host1.DataMember("Items") = "Employees"; G2Host1.DataField(0) = "Items"; G2Host1.DataField(1) = "EmployeeID"; G2Host1.DataField(2) = "ReportsTo"; G2Host1.DataSource("Tasks") = G2Host1.DataSource("Items"); G2Host1.DataMember("Tasks") = "EmployeeDetails"; G2Host1.DataField(7) = "Tasks"; G2Host1.DataField(8) = "EmployeeID"; G2Host1.DataField(9) = "DateStart"; G2Host1.DataField(10) = "DateEnd"; G2Host1.DataField(14) = "TaskID"; G2Host1.DataSource("Links") = G2Host1.DataSource("Items"); G2Host1.DataMember("Links") = "EmployeeLinks"; G2Host1.DataField(15) = "Links"; G2Host1.DataField(16) = "Start"; G2Host1.DataField(17) = "End"; var var_Bar = G2Host1.Host.Chart.Bars.Item("Task"); var_Bar.OverlaidType = 515; var_Bar.OverlaidGroup = "Task,Progress"; G2Host1.Host.Items.ExpandItem(0) = true; G2Host1.Host.Chart.ScrollTo("5/27/2017",1); } </SCRIPT> </BODY> |
20 |
DBF sample ( file )
<BODY onload="Init()"> <SCRIPT FOR="G2Host1" EVENT="Error(Error,Description)" LANGUAGE="JScript"> alert( Error ); alert( Description ); </SCRIPT> <OBJECT CLASSID="clsid:DFE195F7-4F43-482A-A14B-0C97B032A5E1" id="G2Host1"></OBJECT> <SCRIPT LANGUAGE="JScript"> function Init() { G2Host1.DataSource("Items") = "C:\\Program Files\\Exontrol\\ExG2Host\\Sample\\sample.dbf"; G2Host1.DataField(0) = "Items"; } </SCRIPT> </BODY> |
19 |
DAO sample ( object, DAO.DBEngine.120, multiple tasks, multiple tables )
<BODY onload="Init()"> <SCRIPT FOR="G2Host1" EVENT="Error(Error,Description)" LANGUAGE="JScript"> alert( Error ); alert( Description ); </SCRIPT> <OBJECT CLASSID="clsid:DFE195F7-4F43-482A-A14B-0C97B032A5E1" id="G2Host1"></OBJECT> <SCRIPT LANGUAGE="JScript"> function Init() { var var_PrivDBEngine = new ActiveXObject("DAO.DBEngine.120"); var var_Database = var_PrivDBEngine.OpenDatabase("C:\\Program Files\\Exontrol\\ExG2Host\\Sample\\sample.accdb",null,null,null); var rsEmployees = var_Database.OpenRecordset("Employees",null,null,null); var rsTasks = var_Database.OpenRecordset("EmployeeDetails",null,null,null); var rsLinks = var_Database.OpenRecordset("EmployeeLinks",null,null,null); G2Host1.DataSource("Items") = rsEmployees; G2Host1.DataMember("Items") = "Employees"; G2Host1.DataField(0) = "Items"; G2Host1.DataField(1) = "EmployeeID"; G2Host1.DataField(2) = "ReportsTo"; G2Host1.DataSource("Tasks") = rsTasks; G2Host1.DataField(7) = "Tasks"; G2Host1.DataField(8) = "EmployeeID"; G2Host1.DataField(9) = "DateStart"; G2Host1.DataField(10) = "DateEnd"; G2Host1.DataField(14) = "TaskID"; G2Host1.DataSource("Links") = rsLinks; G2Host1.DataField(15) = "Links"; G2Host1.DataField(16) = "Start"; G2Host1.DataField(17) = "End"; var var_Bar = G2Host1.Host.Chart.Bars.Item("Task"); var_Bar.OverlaidType = 515; var_Bar.OverlaidGroup = "Task,Progress"; G2Host1.Host.Items.ExpandItem(0) = true; G2Host1.Host.Chart.ScrollTo("5/27/2017",1); } </SCRIPT> </BODY> |
18 |
DAO sample ( file, multiple tasks, multiple tables )
<BODY onload="Init()"> <SCRIPT FOR="G2Host1" EVENT="Error(Error,Description)" LANGUAGE="JScript"> alert( Error ); alert( Description ); </SCRIPT> <OBJECT CLASSID="clsid:DFE195F7-4F43-482A-A14B-0C97B032A5E1" id="G2Host1"></OBJECT> <SCRIPT LANGUAGE="JScript"> function Init() { G2Host1.DataTechnology("Items") = "DAO.DBEngine.120;DAO.DBEngine.36"; G2Host1.DataSource("Items") = "C:\\Program Files\\Exontrol\\ExG2Host\\Sample\\sample.accdb"; G2Host1.DataMember("Items") = "Employees"; G2Host1.DataField(0) = "Items"; G2Host1.DataField(1) = "EmployeeID"; G2Host1.DataField(2) = "ReportsTo"; G2Host1.DataTechnology("Tasks") = "DAO.DBEngine.120;DAO.DBEngine.36"; G2Host1.DataSource("Tasks") = G2Host1.DataSource("Items"); G2Host1.DataMember("Tasks") = "EmployeeDetails"; G2Host1.DataField(7) = "Tasks"; G2Host1.DataField(8) = "EmployeeID"; G2Host1.DataField(9) = "DateStart"; G2Host1.DataField(10) = "DateEnd"; G2Host1.DataField(14) = "TaskID"; G2Host1.DataTechnology("Links") = "DAO.DBEngine.120;DAO.DBEngine.36"; G2Host1.DataSource("Links") = G2Host1.DataSource("Items"); G2Host1.DataMember("Links") = "EmployeeLinks"; G2Host1.DataField(15) = "Links"; G2Host1.DataField(16) = "Start"; G2Host1.DataField(17) = "End"; var var_Bar = G2Host1.Host.Chart.Bars.Item("Task"); var_Bar.OverlaidType = 515; var_Bar.OverlaidGroup = "Task,Progress"; G2Host1.Host.Items.ExpandItem(0) = true; G2Host1.Host.Chart.ScrollTo("5/27/2017",1); } </SCRIPT> </BODY> |
17 |
DAO sample ( object, DAO.DBEngine.120, single task, single table )
<BODY onload="Init()"> <SCRIPT FOR="G2Host1" EVENT="Error(Error,Description)" LANGUAGE="JScript"> alert( Error ); alert( Description ); </SCRIPT> <OBJECT CLASSID="clsid:DFE195F7-4F43-482A-A14B-0C97B032A5E1" id="G2Host1"></OBJECT> <SCRIPT LANGUAGE="JScript"> function Init() { var var_PrivDBEngine = new ActiveXObject("DAO.DBEngine.120"); var var_Database = var_PrivDBEngine.OpenDatabase("C:\\Program Files\\Exontrol\\ExG2Host\\Sample\\sample.accdb",null,null,null); var rsEmployees = var_Database.OpenRecordset("Employees",null,null,null); var rsLinks = var_Database.OpenRecordset("EmployeeLinks",null,null,null); G2Host1.DataSource("Items") = rsEmployees; G2Host1.DataField(0) = "Items"; G2Host1.DataField(1) = "EmployeeID"; G2Host1.DataField(2) = "ReportsTo"; G2Host1.DataField(7) = G2Host1.DataField(0); G2Host1.DataField(9) = "BirthDate"; G2Host1.DataField(10) = "HireDate"; G2Host1.DataSource("Links") = rsLinks; G2Host1.DataField(15) = "Links"; G2Host1.DataField(16) = "Start"; G2Host1.DataField(17) = "End"; } </SCRIPT> </BODY> |
16 |
DAO sample ( file, single task, single table )
<BODY onload="Init()"> <SCRIPT FOR="G2Host1" EVENT="Error(Error,Description)" LANGUAGE="JScript"> alert( Error ); alert( Description ); </SCRIPT> <OBJECT CLASSID="clsid:DFE195F7-4F43-482A-A14B-0C97B032A5E1" id="G2Host1"></OBJECT> <SCRIPT LANGUAGE="JScript"> function Init() { G2Host1.DataTechnology("Items") = "DAO.DBEngine.120;DAO.DBEngine.36"; G2Host1.DataSource("Items") = "C:\\Program Files\\Exontrol\\ExG2Host\\Sample\\sample.accdb"; G2Host1.DataMember("Items") = "Employees"; G2Host1.DataField(0) = "Items"; G2Host1.DataField(1) = "EmployeeID"; G2Host1.DataField(2) = "ReportsTo"; G2Host1.DataField(7) = G2Host1.DataField(0); G2Host1.DataField(9) = "BirthDate"; G2Host1.DataField(10) = "HireDate"; G2Host1.DataTechnology("Links") = "DAO.DBEngine.120;DAO.DBEngine.36"; G2Host1.DataSource("Links") = G2Host1.DataSource("Items"); G2Host1.DataMember("Links") = "EmployeeLinks"; G2Host1.DataField(15) = "Links"; G2Host1.DataField(16) = "Start"; G2Host1.DataField(17) = "End"; } </SCRIPT> </BODY> |
15 |
DAO sample ( tree recordset )
<BODY onload="Init()"> <SCRIPT FOR="G2Host1" EVENT="Error(Error,Description)" LANGUAGE="JScript"> alert( Error ); alert( Description ); </SCRIPT> <OBJECT CLASSID="clsid:DFE195F7-4F43-482A-A14B-0C97B032A5E1" id="G2Host1"></OBJECT> <SCRIPT LANGUAGE="JScript"> function Init() { G2Host1.DataTechnology("Items") = "DAO.DBEngine.120;DAO.DBEngine.36"; G2Host1.DataSource("Items") = "C:\\Program Files\\Exontrol\\ExG2Host\\Sample\\sample.accdb"; G2Host1.DataMember("Items") = "Employees"; G2Host1.DataField(0) = "Items"; G2Host1.DataField(1) = "EmployeeID"; G2Host1.DataField(2) = "ReportsTo"; } </SCRIPT> </BODY> |
14 |
DAO sample ( flat recordset )
<BODY onload="Init()"> <SCRIPT FOR="G2Host1" EVENT="Error(Error,Description)" LANGUAGE="JScript"> alert( Error ); alert( Description ); </SCRIPT> <OBJECT CLASSID="clsid:DFE195F7-4F43-482A-A14B-0C97B032A5E1" id="G2Host1"></OBJECT> <SCRIPT LANGUAGE="JScript"> function Init() { var var_PrivDBEngine = new ActiveXObject("DAO.DBEngine.120"); var var_Database = var_PrivDBEngine.OpenDatabase("C:\\Program Files\\Exontrol\\ExG2Host\\Sample\\sample.accdb",null,null,null); var rsEmployees = var_Database.OpenRecordset("Employees",null,null,null); G2Host1.DataSource("Items") = rsEmployees; G2Host1.DataField(0) = "Items"; } </SCRIPT> </BODY> |
13 |
DAO sample ( flat )
<BODY onload="Init()"> <SCRIPT FOR="G2Host1" EVENT="Error(Error,Description)" LANGUAGE="JScript"> alert( Error ); alert( Description ); </SCRIPT> <OBJECT CLASSID="clsid:DFE195F7-4F43-482A-A14B-0C97B032A5E1" id="G2Host1"></OBJECT> <SCRIPT LANGUAGE="JScript"> function Init() { G2Host1.DataTechnology("Items") = "DAO.DBEngine.120;DAO.DBEngine.36"; G2Host1.DataSource("Items") = "C:\\Program Files\\Exontrol\\ExG2Host\\Sample\\sample.accdb"; G2Host1.DataMember("Items") = "Employees"; G2Host1.DataField(0) = "Items"; } </SCRIPT> </BODY> |
12 |
ADO sample ( object, ADODB.Recordset, multiple tasks )
<BODY onload="Init()"> <SCRIPT FOR="G2Host1" EVENT="Error(Error,Description)" LANGUAGE="JScript"> alert( Error ); alert( Description ); </SCRIPT> <OBJECT CLASSID="clsid:DFE195F7-4F43-482A-A14B-0C97B032A5E1" id="G2Host1"></OBJECT> <SCRIPT LANGUAGE="JScript"> function Init() { var rsEmployees = new ActiveXObject("ADODB.Recordset"); rsEmployees.Open("Employees","Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\\Program Files\\Exontrol\\ExG2Host\\Sample\\sample.accdb",3,3,null); G2Host1.DataSource("Items") = rsEmployees; G2Host1.DataField(0) = "Items"; G2Host1.DataField(1) = "EmployeeID"; G2Host1.DataField(2) = "ReportsTo"; var rsTasks = new ActiveXObject("ADODB.Recordset"); rsTasks.Open("EmployeeDetails","Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\\Program Files\\Exontrol\\ExG2Host\\Sample\\sample.accdb",3,3,null); G2Host1.DataSource("Tasks") = rstasks; G2Host1.DataField(7) = "Tasks"; G2Host1.DataField(8) = "EmployeeID"; G2Host1.DataField(9) = "DateStart"; G2Host1.DataField(10) = "DateEnd"; G2Host1.DataField(14) = "TaskID"; var rsLinks = new ActiveXObject("ADODB.Recordset"); rsLinks.Open("EmployeeLinks","Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\\Program Files\\Exontrol\\ExG2Host\\Sample\\sample.accdb",3,3,null); G2Host1.DataSource("Links") = rsLinks; G2Host1.DataField(15) = "Links"; G2Host1.DataField(16) = "Start"; G2Host1.DataField(17) = "End"; var var_Bar = G2Host1.Host.Chart.Bars.Item("Task"); var_Bar.OverlaidType = 515; var_Bar.OverlaidGroup = "Task,Progress"; G2Host1.Host.Items.ExpandItem(0) = true; G2Host1.Host.Chart.ScrollTo("5/27/2017",1); } </SCRIPT> </BODY> |
11 |
ADO sample ( file, multiple tasks, multiple tables )
<BODY onload="Init()"> <SCRIPT FOR="G2Host1" EVENT="Error(Error,Description)" LANGUAGE="JScript"> alert( Error ); alert( Description ); </SCRIPT> <OBJECT CLASSID="clsid:DFE195F7-4F43-482A-A14B-0C97B032A5E1" id="G2Host1"></OBJECT> <SCRIPT LANGUAGE="JScript"> function Init() { G2Host1.DataTechnology("Items") = "ADODB.Recordset;ADOR.Recordset"; G2Host1.DataSource("Items") = "C:\\Program Files\\Exontrol\\ExG2Host\\Sample\\sample.accdb"; G2Host1.DataMember("Items") = "Employees"; G2Host1.DataField(0) = "Items"; G2Host1.DataField(1) = "EmployeeID"; G2Host1.DataField(2) = "ReportsTo"; G2Host1.DataTechnology("Tasks") = "ADODB.Recordset;ADOR.Recordset"; G2Host1.DataSource("Tasks") = G2Host1.DataSource("Items"); G2Host1.DataMember("Tasks") = "EmployeeDetails"; G2Host1.DataField(7) = "Tasks"; G2Host1.DataField(8) = "EmployeeID"; G2Host1.DataField(9) = "DateStart"; G2Host1.DataField(10) = "DateEnd"; G2Host1.DataField(14) = "TaskID"; G2Host1.DataTechnology("Links") = "ADODB.Recordset;ADOR.Recordset"; G2Host1.DataSource("Links") = G2Host1.DataSource("Items"); G2Host1.DataMember("Links") = "EmployeeLinks"; G2Host1.DataField(15) = "Links"; G2Host1.DataField(16) = "Start"; G2Host1.DataField(17) = "End"; var var_Bar = G2Host1.Host.Chart.Bars.Item("Task"); var_Bar.OverlaidType = 515; var_Bar.OverlaidGroup = "Task,Progress"; G2Host1.Host.Items.ExpandItem(0) = true; G2Host1.Host.Chart.ScrollTo("5/27/2017",1); } </SCRIPT> </BODY> |
10 |
ADO sample ( object, ADODB.Recordset, single task, single table )
<BODY onload="Init()"> <SCRIPT FOR="G2Host1" EVENT="Error(Error,Description)" LANGUAGE="JScript"> alert( Error ); alert( Description ); </SCRIPT> <OBJECT CLASSID="clsid:DFE195F7-4F43-482A-A14B-0C97B032A5E1" id="G2Host1"></OBJECT> <SCRIPT LANGUAGE="JScript"> function Init() { var rsEmployees = new ActiveXObject("ADODB.Recordset"); rsEmployees.Open("Employees","Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\\Program Files\\Exontrol\\ExG2Host\\Sample\\sample.accdb",3,3,null); G2Host1.DataSource("Items") = rsEmployees; G2Host1.DataField(0) = "Items"; G2Host1.DataField(1) = "EmployeeID"; G2Host1.DataField(2) = "ReportsTo"; G2Host1.DataField(7) = G2Host1.DataField(0); G2Host1.DataField(9) = "BirthDate"; G2Host1.DataField(10) = "HireDate"; var rsLinks = new ActiveXObject("ADODB.Recordset"); rsLinks.Open("EmployeeLinks","Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\\Program Files\\Exontrol\\ExG2Host\\Sample\\sample.accdb",3,3,null); G2Host1.DataSource("Links") = rsLinks; G2Host1.DataField(15) = "Links"; G2Host1.DataField(16) = "Start"; G2Host1.DataField(17) = "End"; } </SCRIPT> </BODY> |
9 |
ADO sample ( file, single task, single table )
<BODY onload="Init()"> <SCRIPT FOR="G2Host1" EVENT="Error(Error,Description)" LANGUAGE="JScript"> alert( Error ); alert( Description ); </SCRIPT> <OBJECT CLASSID="clsid:DFE195F7-4F43-482A-A14B-0C97B032A5E1" id="G2Host1"></OBJECT> <SCRIPT LANGUAGE="JScript"> function Init() { G2Host1.DataTechnology("Items") = "ADODB.Recordset;ADOR.Recordset"; G2Host1.DataSource("Items") = "C:\\Program Files\\Exontrol\\ExG2Host\\Sample\\sample.accdb"; G2Host1.DataMember("Items") = "Employees"; G2Host1.DataField(0) = "Items"; G2Host1.DataField(1) = "EmployeeID"; G2Host1.DataField(2) = "ReportsTo"; G2Host1.DataField(7) = G2Host1.DataField(0); G2Host1.DataField(9) = "BirthDate"; G2Host1.DataField(10) = "HireDate"; G2Host1.DataTechnology("Links") = "ADODB.Recordset;ADOR.Recordset"; G2Host1.DataSource("Links") = G2Host1.DataSource("Items"); G2Host1.DataMember("Links") = "EmployeeLinks"; G2Host1.DataField(15) = "Links"; G2Host1.DataField(16) = "Start"; G2Host1.DataField(17) = "End"; } </SCRIPT> </BODY> |
8 |
ADO sample ( tree recordset )
<BODY onload="Init()"> <SCRIPT FOR="G2Host1" EVENT="Error(Error,Description)" LANGUAGE="JScript"> alert( Error ); alert( Description ); </SCRIPT> <OBJECT CLASSID="clsid:DFE195F7-4F43-482A-A14B-0C97B032A5E1" id="G2Host1"></OBJECT> <SCRIPT LANGUAGE="JScript"> function Init() { G2Host1.DataTechnology("Items") = "ADODB.Recordset;ADOR.Recordset"; G2Host1.DataSource("Items") = "C:\\Program Files\\Exontrol\\ExG2Host\\Sample\\sample.accdb"; G2Host1.DataMember("Items") = "Employees"; G2Host1.DataField(0) = "Items"; G2Host1.DataField(1) = "EmployeeID"; G2Host1.DataField(2) = "ReportsTo"; } </SCRIPT> </BODY> |
7 |
ADO sample ( flat recordset )
<BODY onload="Init()"> <SCRIPT FOR="G2Host1" EVENT="Error(Error,Description)" LANGUAGE="JScript"> alert( Error ); alert( Description ); </SCRIPT> <OBJECT CLASSID="clsid:DFE195F7-4F43-482A-A14B-0C97B032A5E1" id="G2Host1"></OBJECT> <SCRIPT LANGUAGE="JScript"> function Init() { var rsEmployees = new ActiveXObject("ADODB.Recordset"); rsEmployees.Open("Employees","Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\\Program Files\\Exontrol\\ExG2Host\\Sample\\sample.accdb",3,3,null); G2Host1.DataSource("Items") = rsEmployees; G2Host1.DataField(0) = "Items"; } </SCRIPT> </BODY> |
6 |
ADO sample ( flat table )
<BODY onload="Init()"> <SCRIPT FOR="G2Host1" EVENT="Error(Error,Description)" LANGUAGE="JScript"> alert( Error ); alert( Description ); </SCRIPT> <OBJECT CLASSID="clsid:DFE195F7-4F43-482A-A14B-0C97B032A5E1" id="G2Host1"></OBJECT> <SCRIPT LANGUAGE="JScript"> function Init() { G2Host1.DataTechnology("Items") = "ADODB.Recordset;ADOR.Recordset"; G2Host1.DataSource("Items") = "C:\\Program Files\\Exontrol\\ExG2Host\\Sample\\sample.accdb"; G2Host1.DataMember("Items") = "Employees"; G2Host1.DataField(0) = "Items"; } </SCRIPT> </BODY> |
5 |
XML sample ( object, MSXML.DOMDocument )
<BODY onload="Init()"> <SCRIPT FOR="G2Host1" EVENT="Error(Error,Description)" LANGUAGE="JScript"> alert( Error ); alert( Description ); </SCRIPT> <OBJECT CLASSID="clsid:DFE195F7-4F43-482A-A14B-0C97B032A5E1" id="G2Host1"></OBJECT> <SCRIPT LANGUAGE="JScript"> function Init() { var xml = new ActiveXObject("MSXML.DOMDocument"); xml.async = false; xml.load("C:\\Program Files\\Exontrol\\ExG2Host\\Sample\\sample.xml"); G2Host1.DataSource("Items") = xml; G2Host1.DataField(0) = "Items"; var var_G2antt = G2Host1.Host; var_G2antt.LinesAtRoot = -1; var_G2antt.SingleSel = false; var_G2antt.AutoDrag = 3; } </SCRIPT> </BODY> |
4 |
XML sample ( file tree )
<BODY onload="Init()"> <SCRIPT FOR="G2Host1" EVENT="Error(Error,Description)" LANGUAGE="JScript"> alert( Error ); alert( Description ); </SCRIPT> <OBJECT CLASSID="clsid:DFE195F7-4F43-482A-A14B-0C97B032A5E1" id="G2Host1"></OBJECT> <SCRIPT LANGUAGE="JScript"> function Init() { G2Host1.DataTechnology("Items") = "MSXML.DOMDocument"; G2Host1.DataSource("Items") = "C:\\Program Files\\Exontrol\\ExG2Host\\Sample\\sample.xml"; G2Host1.DataField(0) = "Items"; var var_G2antt = G2Host1.Host; var_G2antt.LinesAtRoot = -1; var_G2antt.SingleSel = false; var_G2antt.AutoDrag = 3; } </SCRIPT> </BODY> |
3 |
How can I let user create new items/bars when clicking the empty area of the control
|
2 |
How do I handle events of the host
<BODY onload="Init()"> <SCRIPT FOR="G2Host1" EVENT="HostEvent(EventID)" LANGUAGE="JScript"> alert( G2Host1.HostEventParam(-2) ); </SCRIPT> <OBJECT CLASSID="clsid:DFE195F7-4F43-482A-A14B-0C97B032A5E1" id="G2Host1"></OBJECT> <SCRIPT LANGUAGE="JScript"> function Init() { var var_G2antt = G2Host1.Host; var_G2antt.BeginUpdate(); var_G2antt.Columns.Add("new column"); var_G2antt.EndUpdate(); } </SCRIPT> </BODY> |
1 |
How can I get the version of the host/exg2antt control
<BODY onload="Init()"> <OBJECT CLASSID="clsid:DFE195F7-4F43-482A-A14B-0C97B032A5E1" id="G2Host1"></OBJECT> <SCRIPT LANGUAGE="JScript"> function Init() { alert( G2Host1.Version ); alert( "Host" ); alert( G2Host1.Host.Version ); } </SCRIPT> </BODY> |