javascript - Adding a link to dhtmlxGrid -
i'm using dhtmlxgrid , have number of records i'm returning query in coldfusion. i'm looping on record set , creating json , having grid parse that.
what i'm interested in adding html link 1 column use link go different page specific record.
there example of here: http://www.dhtmlx.com/docs/products/dhtmlxgrid/samples/01_cell_types/04_link_grid.html
the question have i'm using.
mygrid.parse(data, "json"); to load data grid , according docs link created passing xml file grid this:
mygrid.loadxml("../common/grid_links.xml"); it seems if loaded xml screw grid has been created json.
i'm curious if has had same situation or possible use
mygrid.parse(somenewdata, "json"); to load in html information?
tia
is xml have , header
<?php header ("content-type:text/xml"); echo '....your xml data.....'; exit(); ?> it's screwed dhtmlx grid data because xml data not example shown on dhtmlx. set data in xml examples: http://www.dhtmlx.com/docs/products/docsexplorer/doc/dhtmlxxml/index.html
so make sure xml file , simple above. when use iso data under xml tag: <![cdata[ , closed ]]> tag inside <cell> tag. if isn't readable , not giving results thrown errors.
point documentation maybe it's helpful you: http://docs.dhtmlx.com/doku.php?id=dhtmlxgrid:configuration_from_xml
hope helps.
for json @ best describes examples: json php file: http://www.dhtmlx.com/docs/products/dhtmlxgrid/samples/12_initialization_loading/09_init_grid_json.html
and grid rendered layout: http://www.dhtmlx.com/docs/products/dhtmlxgrid/samples/12_initialization_loading/09_init_grid_json.html
if want json file calling uri started "http://..." make sure loaded php file , inside php file render json_encode() data or call manually source within php. files need render example:
json php file myjson.php?callsome=1
<?php if ($_get["callsome"] == "1") { header('content-type: application/json'); echo file_get_contents('http://www.somewhere.com/some.json'); exit(); } and call parse:
mygrid.parse("/myjson.php?callsome=1", "json"); or if need directly assign example including data:
<?php $var = file_get_contents('some_json_data.php'); echo $var; // returned json data included
Comments
Post a Comment