I’m having three problems trying to get a form and grid to bind together properly:
- When trying to save the form I get an uncaught exception error:
-
I have a filter for the grid. When I switch to the form for a record and then do the .showGrid function to redisplay the grid, the grid does not show the previous list (the grid shows no records).
-
The grid highlights the record I select when it switches to the form. But when I select another record the first record selection is not cleared. Every record I have selected is still highlighted in the grid list.
I’ve included the source for my document as it was created from my server program (with data). I believe the relevant code begins with the dhx.ready(function but I’ve included it all in case the problem is elsewhere.
Thank you for your help.
<!DOCTYPE html>
<html>
<head>
<title>SouthWare ExecuView</title>
<base href="http://pz.southware.com/nlhtml15/">
<link rel="stylesheet" href="touchcodebase/touchui.css" type="text/css" media="screen" charset="utf-8">
<script src="touchcodebase/touchui.js" type="text/javascript" charset="utf-8"></script>
<style>
html,body{
background-color:#ffffff;
}
.tb_sup{
font-size:10px;
text-shadow: none;
font-style:italic;
}
td.right {
text-align: right;
}
td.rightheader {
text-align: right;
background-color:#F3F3F3;
}
</style>
<script>
var taskdata=
[
{"id":"000000000000000169","date":"11/17/11","Time":" 800","type":"Call - Outbound ","reference":"submitted via external netlink","result":" ","operator":"DEMOTHIN","days":" 96"},
{"id":"000000000000000181","date":"11/21/11","Time":" 100","type":"Meeting - Off-Site ","reference":"Sales call ","result":" ","operator":"DEMOTHIN","days":" 92"},
{"id":"000000000000001011","date":"10/12/11","Time":" 800","type":"Call - Outbound ","reference":"test ","result":" ","operator":"DEMOTHIN","days":" 132"},
{"id":"000000000000001012","date":"11/09/11","Time":" 15","type":"Call - Outbound ","reference":"test ","result":" ","operator":"DEMOTHIN","days":" 104"},
{"id":"000000000000001013","date":"01/12/12","Time":"1728","type":"Sales Opportunity ","reference":"New Thing ","result":" ","operator":"DEMOTHIN","days":" 40"},
{"id":"000000000000001015","date":"10/14/11","Time":" 814","type":"Send Literature ","reference":" ","result":" ","operator":"DEMOTHIN","days":" 130"},
{"id":"000000000000001017","date":"10/14/11","Time":"2024","type":"Sales Opportunity ","reference":"Replace Tech Dispatch ","result":" ","operator":"DEMOTHIN","days":" 130"},
{"id":"000000000000001019","date":"10/17/11","Time":" 800","type":"Call - Outbound ","reference":"Survey for Current Needs ","result":" ","operator":"DEMOTHIN","days":" 127"},
{"id":"000000000000001020","date":"10/18/11","Time":" 800","type":"Call - Outbound ","reference":"Meeting followup ","result":" ","operator":"DEMOTHIN","days":" 126"},
{"id":"000000000000001021","date":"10/18/11","Time":" 800","type":"Call - Outbound ","reference":"Need Help ","result":" ","operator":"DEMOTHIN","days":" 126"},
{"id":"000000000000001025","date":"10/18/11","Time":" 800","type":"Call - Outbound ","reference":"Checks won't print! ","result":" ","operator":"DEMOTHIN","days":" 126"},
{"id":"000000000000001028","date":"10/18/11","Time":" 800","type":"Call - Outbound ","reference":"Need help with Training ","result":" ","operator":"DEMOTHIN","days":" 126"},
{"id":"000000000000001029","date":"10/31/11","Time":" 800","type":"Call - Outbound ","reference":"Monday task ","result":" ","operator":"DEMOTHIN","days":" 113"},
{"id":"000000000000001030","date":"10/31/11","Time":"1402","type":"Sales Opportunity ","reference":"Testing Competitor ","result":" ","operator":"DEMOTHIN","days":" 113"},
{"id":"000000000000001032","date":"11/30/11","Time":" 800","type":"Call - Outbound ","reference":"Get Credit Info ","result":" ","operator":"DEMOTHIN","days":" 83"},
{"id":"000000000000001033","date":"11/07/11","Time":" 15","type":"Sales Opportunity ","reference":" ","result":" ","operator":"DEMOTHIN","days":" 106"},
{"id":"000000000000001034","date":"11/09/11","Time":" 800","type":"Call - Outbound ","reference":"ffdd ","result":" ","operator":"DEMOTHIN","days":" 104"},
{"id":"000000000000001035","date":"11/10/11","Time":" 800","type":"Call - Outbound ","reference":"fdsfsdfds ","result":" ","operator":"DEMOTHIN","days":" 103"},
{"id":"000000000000001037","date":"11/17/11","Time":" 15","type":"Sales Opportunity ","reference":"testing ","result":" ","operator":"DEMOTHIN","days":" 96"},
{"id":"000000000000001039","date":"11/16/11","Time":"1559","type":"Sales Opportunity ","reference":" ","result":" ","operator":"DEMOTHIN","days":" 97"},
{"id":"000000000000001042","date":"12/06/11","Time":" 840","type":"Sales Opportunity ","reference":"new opportunity ","result":" ","operator":"DEMOTHIN","days":" 77"},
{"id":"000000000000001043","date":"12/06/11","Time":" 928","type":"Sales Opportunity ","reference":" ","result":" ","operator":"DEMOTHIN","days":" 77"},
{"id":"000000000000001044","date":"12/06/11","Time":"1200","type":"Appointment ","reference":"New Task for Refurbish ","result":" ","operator":"DEMOTHIN","days":" 77"},
{"id":"000000000000001045","date":"12/06/11","Time":"1500","type":"Call - Outbound ","reference":"Refurbish ","result":" ","operator":"DEMOTHIN","days":" 77"},
{"id":"000000000000001046","date":"12/06/11","Time":" 800","type":"In person ","reference":"Another refurbish ","result":" ","operator":"DEMOTHIN","days":" 77"},
{"id":"000000000000001047","date":"12/06/11","Time":" 800","type":"Callback ","reference":"Try again ","result":" ","operator":"DEMOTHIN","days":" 77"},
{"id":"000000000000001048","date":"12/06/11","Time":" 800","type":"Meeting - Off-Site ","reference":"testing ","result":" ","operator":"DEMOTHIN","days":" 77"},
{"id":"000000000000001049","date":"12/06/11","Time":" 800","type":"Appointment ","reference":"Another one ","result":" ","operator":"DEMOTHIN","days":" 77"},
{"id":"000000000000001050","date":"12/06/11","Time":" 800","type":"Call - Outbound ","reference":"Testing add task ","result":" ","operator":"DEMOTHIN","days":" 77"},
{"id":"000000000000001051","date":"12/09/11","Time":" 918","type":"Sales Opportunity ","reference":" ","result":" ","operator":"DEMOTHIN","days":" 74"},
{"id":"000000000000001052","date":"12/09/11","Time":" 958","type":"Sales Opportunity ","reference":" ","result":" ","operator":"DEMOTHIN","days":" 74"},
{"id":"000000000000001053","date":"12/09/11","Time":"1226","type":"Sales Opportunity ","reference":"interested in new product ","result":" ","operator":"DEMOTHIN","days":" 74"},
{"id":"000000000000001054","date":"12/20/11","Time":"1330","type":"Call - Outbound ","reference":"Collection Notes ","result":" ","operator":"DEMOTHIN","days":" 63"},
{"id":"000000000000001055","date":"01/24/12","Time":" 800","type":"Call - Outbound ","reference":"testing ","result":" ","operator":"DEMOTHIN","days":" 28"},
{"id":"000000000000001056","date":"01/24/12","Time":" 800","type":"Meeting - Off-Site ","reference":" ","result":" ","operator":"DEMOTHIN","days":" 28"},
{"id":"000000000000001057","date":"01/24/12","Time":" 800","type":"Call - Outbound ","reference":"sales notes ","result":" ","operator":"DEMOTHIN","days":" 28"},
{"id":"000000000000001058","date":"01/24/12","Time":" 800","type":"Call - Outbound ","reference":"sales call ","result":" ","operator":"DEMOTHIN","days":" 28"},
{"id":"000000000000001060","date":"02/08/12","Time":"1447","type":"Followup ","reference":"Joe needs help ","result":" ","operator":"DEMOTHIN","days":" 13"},
{"id":"000000000000001061","date":"02/21/12","Time":"1601","type":"Call - Outbound ","reference":"New Task ","result":" ","operator":"DEMOTHIN","days":" 0"},
];
//Daily Sales chart
var dailySalesData = [
//{ "CurrYr":"0", "LastYr":"0", date:"11/18/11" },
//{ "CurrYr":"0", "LastYr":"0", date:"11/21/11" },
{ "CurrYr":"0", "LastYr":"0", date:"12/09/11" },
{ "CurrYr":"0", "LastYr":"0", date:"12/20/11" },
{ "CurrYr":"0", "LastYr":"0", date:"01/17/12" },
{ "CurrYr":"0", "LastYr":"54", date:"01/26/12" }
];
var dailySales = {
view:"chart",
type:"line",
id:"daily",
series:[
{value:"#CurrYr#",
item:{borderColor: "#3399ff",color: "#ffffff"},
line:{color:"#3399ff",width:3}
},
{value:"#LastYr#",
item:{borderColor: "#66cc00",color: "#ffffff"},
line:{color:"#66cc00",width:3}
}
],
xAxis:{
template:"#date#"
},
yAxis:{
//start:-2,
//step:1,
//end:8
},
padding:{left:35,bottom:20},
origin:0,
legend:{layout:"x",width: 75,align:"center",valign:"top",marker:{type:"round",width:15},
values:[
{text:"Daily Orders",color:"#3399ff"},
{text:"Daily Invoices",color:"#66cc00"}
]
},
data: dailySalesData,
datatype: "json"
};
//End Daily Sales graph
//*Start Receivables Pie Chart*/
var ARpieData = [
{ categ:"CURRENT", amt:"-2,197" },
{ categ:"1 - 30 DAYS", amt:"0" },
{ categ:"31 - 60 DAYS", amt:"17,200" },
{ categ:"OVER 60 DAYS", amt:"73,347,608" }
];
var ARpie = {
view:"chart",
id:"pie",
type:"pie",
value:"#amt#",
pieInnerText:"#amt#",
gradient:true,
legend:{
valign:"top",
width:150,
template:"#categ#"
},
padding:{
left:0,
right:0,
top:15,
bottom:15
},
data: ARpieData,
datatype: "json"
};
//End A/R Pie Chart
//Weekly Sales chart
var weeklySalesData = [
{ "CurrYr":"64", date:"11/01/11" },
{ "CurrYr":"54", date:"11/08/11" },
{ "CurrYr":"27", date:"11/15/11" },
{ "CurrYr":"0", date:"11/22/11" },
{ "CurrYr":"0", date:"12/13/11" },
{ "CurrYr":"54", date:"01/31/12" }
];
var weeklySales = {
view:"chart",
type:"line",
id:"wksales",
series:[
{value:"#CurrYr#",
item:{borderColor: "#66cc00",color: "#ffffff"},
line:{color:"#66cc00",width:3}
},
],
label:'#date#',
xAxis:{
template:" "
},
yAxis:{
//start:-2,
//step:1,
//end:8
},
padding:{bottom:20},
//origin:0,
legend:{layout:"x",width: 75,align:"center",valign:"top",marker:{type:"round",width:15},
values:[
{text:"Weekly Sales",color:"#66cc00"}
]
},
data: weeklySalesData,
datatype: "json"
};
//End Weekly Sales graph
//Monthly Sales chart
var monthlySalesData = [
{ "CurrYr":"3600", "LastYr":"0", date:"08/10" },
{ "CurrYr":"1706", "LastYr":"0", date:"09/10" },
{ "CurrYr":"302", "LastYr":"0", date:"10/10" },
{ "CurrYr":"1322", "LastYr":"0", date:"11/10" },
{ "CurrYr":"1754", "LastYr":"67", date:"12/10" },
{ "CurrYr":"175", "LastYr":"0", date:"01/11" }
];
var monthlySales = {
view:"chart",
type:"line",
id:"monthsales",
series:[
{value:"#CurrYr#",
item:{borderColor: "#3399ff",color: "#ffffff"},
line:{color:"#3399ff",width:3}
},
{value:"#LastYr#",
item:{borderColor: "#66cc00",color: "#ffffff"},
line:{color:"#66cc00",width:3}
}
],
label:'#date#',
xAxis:{
template:" "
},
yAxis:{
//start:-2,
//step:1,
//end:8
},
padding:{left:35,bottom:20},
origin:0,
legend:{layout:"x",width: 75,align:"center",valign:"top",marker:{type:"round",width:15},
values:[
{text:"Monthly Sales",color:"#3399ff"},
{text:"Last Year",color:"#66cc00"}
]
},
data: monthlySalesData,
datatype: "json"
};
//End Monthly Sales graph
//Monthly Cash chart
var monthlyCashData = [
{ "CurrYr":"189524973", date:"12/09" },
{ "CurrYr":"189545952", date:"03/10" },
{ "CurrYr":"189536999", date:"10/10" },
{ "CurrYr":"190348500", date:"11/11" },
{ "CurrYr":"190348500", date:"12/11" },
{ "CurrYr":"190348500", date:"01/12" }
];
var monthlyCash = {
view:"chart",
type:"line",
id:"monthcash",
series:[
{value:"#CurrYr#",
item:{borderColor: "#66cc00",color: "#ffffff"},
line:{color:"#66cc00",width:3}
},
],
label:'#date#',
xAxis:{
template:" "
},
yAxis:{
//start:-2,
//step:1,
//end:8
},
padding:{bottom:20},
//origin:0,
legend:{layout:"x",width: 75,align:"center",valign:"top",marker:{type:"round",width:15},
values:[
{text:"Monthly Cash Balance",color:"#66cc00"}
]
},
data: monthlyCashData,
datatype: "json"
};
//End Monthly Cash graph
//Monthly Profits chart
var monthlyProfitData = [
{ "CurrYr":"1800", date:"08/10" },
{ "CurrYr":"1044", date:"09/10" },
{ "CurrYr":"237", date:"10/10" },
{ "CurrYr":"742", date:"11/10" },
{ "CurrYr":"721", date:"12/10" },
{ "CurrYr":"375", date:"01/11" }
];
var monthlyProfit = {
view:"chart",
type:"bar",
color:"#3399ff",
id:"monthprofit",
series:[
{value:"#CurrYr#",
item:{borderColor: "#3399ff",color: "#ffffff"},
line:{color:"#3399ff",width:3}
},
],
label:'#date#',
xAxis:{
template:" "
},
yAxis:{
//start:-2,
//step:1,
//end:8
},
padding:{bottom:20},
origin:0,
legend:{layout:"x",width: 75,align:"center",valign:"top",marker:{type:"round",width:15},
values:[
{text:"Monthly Profit",color:"#3399ff"}
]
},
data: monthlyProfitData,
datatype: "json"
};
//End Monthly Profit graph
var salesscreen="<table width='100%'><tr><td class='rightheader'></td><td class='rightheader'>Count</td><td class='rightheader'>Amount</td></tr><tr><td>Total Orders</td><td class='right'>737</td><td class='right'>187,085.22</td></tr> <tr><td>--Sched Today</td><td class='right'>327</td><td class='right'>89,181.02</td></tr><tr><td>--Waiting Approval</td><td class='right'>1</td><td class='right'>110.76</td></tr><tr><td>--w/Backorders</td><td class='right'>147</td><td class='right'>103,598.59</td></tr><tr><td>--On Credit Hold</td><td class='right'>4</td><td class='right'>2,460.72</td></tr></table>";
var profitscreen="Period Ending 02/06/12<br><table width='100%'><tr><td class='rightheader'></td><td class='rightheader'>PTD-Curr</td><td class='rightheader'>YTD-Curr</td></tr><tr><td>Sales</td><td class='right'>0</td><td class='right'>50</td></tr> <tr><td>Cost of Sales</td><td class='right'>0</td><td class='right'>10</td></tr><tr><td>Oper Exp</td><td class='right'>0</td><td class='right'>85,071</td></tr><tr><td>Other</td><td class='right'>0</td><td class='right'>17,019</td></tr><tr><td>Net Income</td><td class='right'>0</td><td class='right'>-68,012</td></tr></table>";
var balscreen="As of 02/06/12<br><table width='100%'><tr><td class='rightheader'></td><td class='rightheader'>YTD</td><td class='rightheader'>Last Year</td></tr> <tr><td>----Cash</td><td class='right'>190,350,653</td><td class='right'>190,348,500</td></tr><tr><td>Curr Assets</td><td class='right'>263,270,605</td><td class='right'>263,336,514</td></tr><tr><td>Other Assets</td><td class='right'>59,367</td><td class='right'>59,367</td></tr><tr><td>Curr Liab</td><td class='right'>19,019,756</td><td class='right'>19,017,652</td></tr><tr><td>Other Liab</td><td class='right'>0</td><td class='right'>0</td></tr><tr><td>Capital</td><td class='right'>244,309,831</td><td class='right'>244,378,218</td></tr></table>";
var finother1="As of 02/06/12<br><table width='100%'><tr><td class='rightheader'></td><td class='rightheader'>Count</td><td class='rightheader'>Value</td></tr> <tr><td>Open POs</td><td class='right'>95</td><td class='right'>$2,539,546.11</td></tr><tr><td>Sales Backorders</td><td class='right'>147</td><td class='right'>$103,598.59</td></tr><tr><td>Open Svc Calls</td><td class='right'>59</td><td class='right'>$8,557.50</td></tr></table>";
var finother2="<hr><table width='100%'><tr><td colspan=3><b>Receivables:</b></td></tr><tr><td>CURRENT</td><td class='right'></td><td class='right'>$-2,197</td></tr><tr><td>1 - 30 DAYS</td><td class='right'></td><td class='right'>$0</td></tr><tr><td>31 - 60 DAYS</td><td class='right'></td><td class='right'>$17,200</td></tr><tr><td>OVER 60 DAYS</td><td class='right'></td><td class='right'>$73,347,608</td></tr></table>";
var finotherscreen=finother1 + finother2;
var graphscreen="text";
var config={
waitMessage:true,
container:"groupBox",
rows:[
//Main header for ExecuView portal
{ view:"toolbar", id:"mainheading",
type:"MainBar",
elements:[
{view:"label", label: "<img src='smflame.jpg'> SouthWare <sup class='tb_sup'>mobile</sup> ExecuView", align:'left'}
]
},
{
gravity:2,
view:"multiview",
cells:[
//Sales view start
{ view: 'layout', type: 'wide',
rows: [
{ view: 'template', template:salesscreen, id: 'template_3'},
dailySales
], id: 'tabbar_1'
},
//Task Grid start
{ view: "multiview",
cells:[
{ view: 'layout', type: 'wide', id: 'layout_grid',
rows: [
{ view:"toolbar", id:"TaskBar", type:"SubBar",
elements:[
{ view:"button", id:'b1', label: "Today", align:"center", click:"filterTasksToday()"},
{ view:"button", id:'b2', label: "+/- 7", align:"center", click:"filterTasks7()"},
{ view:"button", id:'b3', label: "All", align:"center", click:"filterTasksAll()"},
{ view:"imagebutton", src:"images/add.png", label:"Add", align:"center"}
//{ view:"button", id:'b4', label: "Add", align:"center", click:"filterTasksAll()"}
]
},
{ view:"grid", id:"taskgrid",
container:"grid_container",
select:true, adjust:true, scroll:"xy",
fields:[
{
id:"date",
width:90,
label:"Date",
template:"#date#",
},
{
id:"type",
width:150,
label:"Type",
template:"#type#",
type:"custom"
},
{
id:"reference",
width:300,
label:"Reference",
template:"#reference#",
}
],
datatype:"json", data:"taskdata"
}
]
},
//Task form start
// { view: 'form', id:"taskform", scroll: true,
// elements: [
// { view:"toolbar", type:"SubBar", id:"taskformbar",
// elements:[
// { view:"button", label:"Back", id:"backButton", click:"showGrid();"},
// { view:"button", label:"Save", id:"saveButton"},
// { view:"button", label:"Finish", id:"finishButton"}
// ]},
//{ view: "button", label:"Save", id:"saveButton", name:"saveButton"},
// { view: 'datepicker', label: 'Date', startOnMonday: true, navigation: true, skipEmptyWeeks: true, dateFormat: '%m/%d/%y', calendarMonthHeader: '%F %Y', calendarDayHeader: '%d', calendarWeek: '%W', cellAutoHeight: true, id: 'date', name: 'date'},
// { view: 'richselect', label: 'Time', id: 'time', name: 'time', datatype: 'json', url: './data/sample_select.json'},
// { view:"text", label:"Type", name:"type", readonly: 1},
// { view: 'richselect', label: 'Result', id: 'result', name: 'result', datatype: 'json', url: './data/sample_select.json'},
// { view:"text", label:"Ref", name:"reference" },
// { view: 'textarea', label: 'Text', id: 'tasktext', name: 'tasktext'}
// ]
// }
{ view: 'layout', type: 'wide', id: 'layout_form',
rows: [
{ view:"toolbar", type:"SubBar", id:"taskformbar",
elements:[
{ view:"button", label:"Back", id:"backButton", click:"showGrid();"},
{ view:"button", label:"Save", id:"saveButton"},
{ view:"imagebutton", src:"images/check2.png", label:"Done", align:"center"}
//{ view:"button", label:"Finish", id:"finishButton"}
]},
//Task form start
{view:"form", id:"taskform", scroll:true, elements:[
{ view:"datepicker", label:"Date", name:"date", dateFormat:"%m/%d/%y"},
{ view:"text", label:"Ref", name:"reference" },
{ view: 'input', label: '', type: 'hidden', name: 'session_no', id: 'session_no', value: '4EFZ9D4DDTGE9GD41GB9ZEO7E',hidden:true},
{ view: 'input', label: '', type: 'hidden', name: 'request_id', value: 'MPTASKUPD',hidden:true},
{ view:"textarea", label:"Text", name:"Textarea", inputHeight:'300', inputWidth:'400' }
]
}
]}
],
id: 'tabbar_2'
},
//Financial Statement start
{ view: 'layout', type: 'wide',
rows: [
{ view:"toolbar", id:"FSBar", type:"SubBar",
elements:[
{ view:"segmented", id:'FStabbar', selected: 'finincome', inputWidth:300, multiview:true,
options: [
{ label: 'Inc Stmt', src: 'images/profit32.png', value: 'finincome'},
{ label: 'Bal Sheet', src: 'images/scales32.png', value: 'finbalance'},
{ label: 'Other', src: 'images/balance32.png', value: 'finother'}
]}
]
},
{ view: "multiview", type: "wide",
cells: [{view: 'template', template:profitscreen, id: 'finincome'},
{view: 'template', template:balscreen, id: 'finbalance'},
{view: 'template', template:finotherscreen, id: 'finother'}
], id: 'multiview_fs'
}
],
id: 'tabbar_3'
},
//Graphs carousel start
{ view: 'carousel',
cols: [
monthlySales,
weeklySales,
monthlyProfit,
monthlyCash,
{ view: 'layout', type: 'wide',
rows: [
{ view: 'toolbar', id: 'temp_designer_view_5', type:"SubBar", align:"center",
elements:[{template:"A/R Aging Analysis"}]
},
ARpie
]
}
],
panel: {}, id: 'tabbar_4'
},
//Alert list start
{ template:"Alert list", id:"tabbar_5" }
]
},
//start Main toolbar for tabs
{
view:"toolbar",
id:"BottomBar", type:"BigTabBar",
elements:[
{ view:"tabbar", id:'bottomtabbar', selected: 'tabbar_1', inputWidth:300, options: [
{ label: 'Sales', src: 'images/linechart32.png', value: 'tabbar_1'},
{ label: 'Tasks', src: 'images/tasks32.png', value: 'tabbar_2'},
{ label: 'Financial', src: 'images/dollar32.png', value: 'tabbar_3'},
{ label: 'Graphs', src: 'images/barchart32.png', value: 'tabbar_4'},
{ label: 'Alerts', src: 'images/news_new32.png', value: 'tabbar_5'}
]}
]
}
]
};
dhx.ready(function(){
dhx.ui(config);
$$("BottomBar").attachEvent("onBeforeTabClick",function(button,id){
$$(id).show();
return true
});
var dp = new dhx.DataProcessor({
master:$$('taskgrid'), //specifies a linked datasource
url:"http://pz.southware.com/cgi-nl/NLNET15.BAT" //defines the path to the file which will get change requests
});
$$('taskform').bind('taskgrid');
$$('taskgrid').attachEvent("onitemclick", function(taskid){
loadTexttoForm(taskid);
$$('layout_form').show();
});
$$('saveButton').attachEvent("onItemClick", function(){
saveTask();
});
filterTasksToday();
});
function showGrid() {
$$('layout_grid').show();
};
function saveTask() {
var saveTaskURL = "http://pz.southware.com/cgi-nl/NLNET15.BAT";
dhx.ajax().sync().post(saveTaskURL, $$('taskform').getValues(), function(text, xml, xhr){
alert("text: "+text);
if (text.substr(0,2) == "OK") {
$$('taskform').save();
alert("Task Saved"); //debug
showGrid();
};
});
};
function filterTasksToday() {
$$('taskgrid').filter(function(obj){
if (obj.days == 0) return true;
return false;
});
};
function filterTasks7() {
$$('taskgrid').filter(function(obj){
if (obj.days < 8 && obj.days > -8) return true;
return false;
});
};
function filterTasksAll() {
$$('taskgrid').filter(function(obj){
if (obj.days < 99999999) return true;
return false;
});
};
//runs Ajax job to get task for text and place in form
function loadTexttoForm(task) {
var getTextURL = "http://pz.southware.com/cgi-nl/NLNET15.BAT?session_no=4EFZ9D4DDTGE9GD41GB9ZEO7E&request_id=MPTASKTEXT&task_no="+task;
var gotText="";
dhx.ajax(getTextURL, function(gotText, xml, XmlHttpRequest){
$$('taskform').setValues({
Textarea: gotText
});
});
};
</script>
<body>
<div style="width:320px;height:450px;border:1px solid #969696; margin:50px;">
<div id="groupBox" style='width:100%; height:100%;'>
</div>
</div>
<div id="grid_container" style="width:700px;height:288px;"></div>
</body>
</html>