Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by dave on Nov 08, 2009 23:50
open dhtmlx forum
Error type: loadXML

Hello,

I try to use dhtmlxGrid in my application,but always get an error "Error type: loadXML. Incorrect XML file"

I try to use your example as is and also get a same error. See it in http://www.maale-rahavam.net/tabsheet/dhtmlxGrid/dhtmlxGrid/samples/04_dataprocessor/05_basic_validation.html

I need to get data from php file,there i get all neccesery fields from database and show it in the grid. Please help.
Answer posted by Stanislav (support) on Nov 09, 2009 04:55
You can open php file in separate window to check the reason of the error

<br />
<b>Warning</b>:  mysql_connect() [<a href='function.mysql-connect'>function.mysql-connect</a>]: Access denied for user 'dhtmuzer_ro'@'sonic.host-care.com' (using password: YES) in <b>/home/maalerah/public_html/tabsheet/dhtmlxGrid/dhtmlxGrid/samples/common/config_dp.php</b> on line <b>7</b><br />
<br />

It seems that used login|pass info is not correct

Answer posted by Dave on Nov 09, 2009 08:58

hello Stanislav

i create 2 new pages,but data is not loaded also from localhost db. check the code below and also look at link http://www.maale-rahavam.net/tabsheet/grid.php

grid.php

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xml; charset=utf-8" />

<link rel="stylesheet" type="text/css" href="libs/grid/codebase/dhtmlxgrid.css">
<script  src="libs/grid/codebase/dhtmlxcommon.js"></script>
<script src="libs/grid/codebase/dhtmlxgrid.js"></script>
<script src="libs/grid/codebase/dhtmlxgridcell.js"></script>
<script src="libs/connector/codebase/connector.js"></script>
</head>

<body>

<div id="gridbox" style="width:100%;height:100%;overflow:hidden"></div>

  <script>//init grid and set its parameters (this part as always);
    mygrid = new dhtmlXGridObject('gridbox');
    mygrid.setImagePath("libs/tabs/codebase/imgs/");
    mygrid.setHeader("name,family name");
    mygrid.setInitWidths("100,*");
    //mygrid.setColAlign("right,left,left,right,center,left,center,center");
    mygrid.setColTypes("ed,ed");
    mygrid.setSkin("dhx_skyblue");
    mygrid.init();
    mygrid.load("get.php");
    

</script>

 

 


</body>
</html>

 

get.php

<?php
require_once("connections/db.class.php");
    $res=mysql_connect($hostname,$username,$password);
    mysql_select_db($database);

    require("libs/connector/codebase/grid_connector.php");
    $grid = new GridConnector($res);
    $grid->enable_log("temp.log",true);
    $grid->dynamic_loading(100);
    $grid->render_table("t_pay","september","october");

?>

Answer posted by Dave on Nov 09, 2009 09:00
by the way its look in standart php,without ajax http://www.maale-rahavam.net/tabsheet/tabs_old.php">http://www.maale-rahavam.net/tabsheet/tabs_old.php all db connections from same db.class.php works
Answer posted by Alex (support) on Nov 10, 2009 01:25

Hello,

the issue is already solved. Am I right ?

Answer posted by dave on Nov 10, 2009 02:47
nope.its still not show data
Answer posted by Alex (support) on Nov 10, 2009 02:56

Hello, 

data loaded. But it isn't shown because of the height of the container. It seems that container has 0 height.

Please, check that that grid container has desired height (try to set it 200px for example - and you will be the rows)

Answer posted by dave on Nov 10, 2009 10:58

yep.its work. tnx.

another question: how to send selected data from grid to form in other tab?

Answer posted by Alex (support) on Nov 11, 2009 02:09

You can use getValue method to get value of the cell. For example:

var values = [];

var rowId = grid.getSelectedRowId()

grid.forEachCell(rowId,function(cellObj){

    values[values.length] = cellObj.getValue();

});