I got it to work using Stanislavs suggestion, but changing ONCE the VisualDesigner generated .js file to comment out Function init(){ like this /* function init() {/ and to comment out the ending brace for the function like this /}*/.
See working VisualDesigner AND Inline src code below. Ididn’t have to mess with the /#CONFIG#/ code at the end at all.
[code]/* function init(){ /
/#GENERATED_CODE#*/ dhtmlx.image_path=’./codebase/imgs/’;
var main_layout = new dhtmlXLayoutObject(document.body, '1C');
var WBSLookup = main_layout.cells('a');
WBSLookup.setText('Cost Code to WBS lookup');
var CostCode3 = WBSLookup.attachGrid();
CostCode3.setIconsPath('./codebase/imgs/');
CostCode3.setHeader(["Phase","Dept ID","Resource","Account","Fund","Extended","WBS","Column 8"]);
CostCode3.setColTypes("ed,ed,ed,ed,ed,ed,ed,ro");
CostCode3.attachHeader(["#text_filter","#text_filter","#text_filter","#text_filter","#text_filter","#text_filter","#text_filter",""]);
CostCode3.setColAlign('left,left,left,left,left,left,left,left');
CostCode3.setColSorting('str,str,str,str,str,str,str,str');
CostCode3.groupBy('0');
CostCode3.init();
CostCode3.load('./data/grid.php', 'xml');
var toolbar = WBSLookup.attachToolbar();
toolbar.setIconsPath('./codebase/imgs/');
toolbar.attachEvent('onClick', function(id){
if(id=="addRow"){
var newId = (new Date()).valueOf()
CostCode3.addRow(newId,"%,%,%,%,None",CostCode3.getRowsNum())
CostCode3.selectRow(CostCode3.getRowIndex(newId),false,false,true);
}else if(id=="delRow"){
var rowId = CostCode3.getSelectedRowId();
if(rowId!=null){
CostCode3.deleteRow(CostCode3.getSelectedRowId());
}
}
});
toolbar.loadXML('./data/toolbar.xml', function(){});
/#END_GENERATED_CODE#/
/}/
/#CONFIG#/
var stored_data = [{“element”:“fake”,“id”:“gui”,"_text":“Main UI”,“freeze”:true,“open”:true,"$parent":0,"$level":1,"$count":1,"$selected":false},{“element”:“main_layout”,“open”:true,“id”:“top”,“name”:“main_layout”,"_text":“Main Layout : main_layout”,“events”:{},“freeze”:“partially”,“image_path”:"./codebase/imgs/",“scheme”:“1C”,"$parent":“gui”,"$level":2,"$count":1,"$selected":false,“container”:"",“status”:0,“toolbar”:0},{“element”:“cell”,“id”:“1”,“cell_name”:“a”,“name”:“WBSLookup”,“events”:{},"_text":“Cell : WBSLookup”,"$parent":“top”,"$level":3,"$count":2,"$selected":false,“header”:“Cost Code to WBS lookup”,“collaps_header”:"",“open”:true,“body”:“grid”,“toolbar”:1},{“element”:“grid”,"_text":“Grid : CostCode3”,“datatype”:“xml”,“icon_path”:"./codebase/imgs/",“datasource”:“grid.php”,“date_format”:"%m/%d/%Y",“per_page”:“6”,“selectors”:“3”,“style”:“toolbar”,“paging_css”:“height:25px;text-align:left;background:transparent;border-color:white;padding:0px;”,“events”:{},“id”:1345664284918,"$count":8,"$level":4,"$parent":“1”,“name”:“CostCode3”,“open”:true,“key_support”:“1”,"$selected":true,“context_menu”:"",“smartrendering”:0,“paging”:0,“ss_selCell”:"",“ss_grid”:""},{“element”:“column”,"_text":“Column : phase”,“format”:“0,000.00”,“group_sep”:" “,“dec_sep”:”.",“events”:{},“id”:1345664285195,"$count":1,"$level":5,"$parent":1345664284918,“name”:“phase”,“label”:“Phase”,"$selected":false,“readonly_cell”:0,“type”:“ed”,“group”:1,“width”:"",“min_width”:"",“header_style”:"",“open”:true},{“element”:“header_line”,"_text":“Header”,“events”:{},“id”:1345764731912,"$count":0,"$level":6,"$parent":1345664285195,“type”:"#text_filter","$selected":false,“label”:""},{“element”:“column”,"_text":“Column : dept”,“format”:“0,000.00”,“group_sep”:" “,“dec_sep”:”.",“events”:{},“id”:1345664284919,"$count":1,"$level":5,"$parent":1345664284918,“name”:“dept”,“label”:“Dept ID”,"$selected":false,“type”:“ed”,“align”:“left”,“open”:true,“group”:0},{“element”:“header_line”,"_text":“Header”,“events”:{},“id”:1345764731935,"$count":0,"$level":6,"$parent":1345664284919,“type”:"#text_filter","$selected":false},{“element”:“column”,"_text":“Column : resource”,“format”:“0,000.00”,“group_sep”:" “,“dec_sep”:”.",“events”:{},“id”:1345664284920,"$count":1,"$level":5,"$parent":1345664284918,“name”:“resource”,“label”:“Resource”,"$selected":false,“type”:“ed”,“align”:“left”,“open”:true},{“element”:“header_line”,"_text":“Header”,“events”:{},“id”:1345764731950,"$count":0,"$level":6,"$parent":1345664284920,“type”:"#text_filter","$selected":false},{“element”:“column”,"_text":“Column : account”,“format”:“0,000.00”,“group_sep”:" “,“dec_sep”:”.",“events”:{},“id”:1345664285178,"$count":1,"$level":5,"$parent":1345664284918,“name”:“account”,“label”:“Account”,"$selected":false,“type”:“ed”,“align”:“left”,“open”:true},{“element”:“header_line”,"_text":“Header”,“events”:{},“id”:1345764731967,"$count":0,"$level":6,"$parent":1345664285178,“type”:"#text_filter","$selected":false},{“element”:“column”,"_text":“Column : fund”,“format”:“0,000.00”,“group_sep”:" “,“dec_sep”:”.",“events”:{},“id”:1345664285183,"$count":1,"$level":5,"$parent":1345664284918,“name”:“fund”,“label”:“Fund”,"$selected":false,“type”:“ed”,“align”:“left”,“open”:true},{“element”:“header_line”,"_text":“Header”,“events”:{},“id”:1345764731982,"$count":0,"$level":6,"$parent":1345664285183,“type”:"#text_filter","$selected":false},{“element”:“column”,"_text":“Column : extended”,“format”:“0,000.00”,“group_sep”:" “,“dec_sep”:”.",“events”:{},“id”:1345664285188,"$count":1,"$level":5,"$parent":1345664284918,“name”:“extended”,“label”:“Extended”,"$selected":false,“type”:“ed”,“align”:“left”,“open”:true},{“element”:“header_line”,"_text":“Header”,“events”:{},“id”:1345764731997,"$count":0,"$level":6,"$parent":1345664285188,“type”:"#text_filter","$selected":false},{“element”:“column”,"_text":“Column : phaseWBS”,“format”:“0,000.00”,“group_sep”:" “,“dec_sep”:”.",“events”:{},“id”:1345664285200,"$count":1,"$level":5,"$parent":1345664284918,“name”:“phaseWBS”,“label”:“WBS”,"$selected":false,“type”:“ed”,“open”:true},{“element”:“header_line”,"_text":“Header”,“events”:{},“id”:1345764732014,"$count":0,"$level":6,"$parent":1345664285200,“type”:"#text_filter","$selected":false},{“element”:“column”,"_text":“Column : column_15”,“format”:“0,000.00”,“group_sep”:" “,“dec_sep”:”.",“events”:{},“id”:1346167605561,"$count":0,"$level":5,"$parent":1345664284918,“name”:“column_15”,“label”:“Column 8”},{“element”:“toolbar”,"_text":“Toolbar : toolbar”,“datasource”:“DefaultToolbar”,“events”:{“onClick”:“if(id==“addRow”){\n\t\tvar newId = (new Date()).valueOf()\n CostCode3.addRow(newId,”%,%,%,%,None",CostCode3.getRowsNum())\n CostCode3.selectRow(CostCode3.getRowIndex(newId),false,false,true);\n\t}else if(id==“delRow”){ \n\t\tvar rowId = CostCode3.getSelectedRowId();\n \t\t\t\t\t\t\tif(rowId!=null){\n CostCode3.deleteRow(CostCode3.getSelectedRowId());\n }\n }"},“id”:1345739268655,"$count":0,"$level":4,"$parent":“1”,“iconpath”:"./codebase/imgs/",“name”:“toolbar”,"$selected":false},{“element”:“windows”,“id”:“windows”,“name”:“windows”,"_text":“Popups”,“freeze”:“partially”,"$parent":0,"$level":1,"$count":0,"$selected":false}];
/#END_CONFIG#/[/code]