メモ

データベースからgird向けのjsonを作る†

$dbh = new PDO($dsn, $user, $password);
$sql="SELECT prefectures_code,count(site) as sites FROM municipality_info";
$sth = $dbh->prepare($sql);
$sth->execute();
$n=1;
$row = array();
while($res = $sth->fetch(PDO::FETCH_ASSOC)){
  $row[] = array( "id"=>$n, "data"=> array($res['prefectures_code'], $res['sites']) );
  $n++;
}
echo json_encode( array("rows"=>$row) );

2つのGrid向けのjsonを引き受ける†

php
  echo json_encode( array( array("rows"=>$row1), array("rows"=>$row2) ) );
---------
dhtmlx
  $.ajax({
     type:"POST",url:"sql.php",data:{"query":myForm.getItemValue("search")}
  }).done(function(res){
     data_arr = JSON.parse(res);
     dhtmlxgrid1.parse(data_arr[0],"json");
     dhtmlxgrid2.parse(data_arr[1],"json");
  });

layoutを超えて全体でwindowを表示する†

https://docs.dhtmlx.com/layout__dhxwins.html

popupWindow = myLayout.dhxWins.createWindow( "popup" , 1, 1, 800, 500);

layoutの特定のcell内で表示したい場合は、仮の「<div id='win'></div>」を設置して、
まず、「myLayout.cells("a").attachObject("win");」で'win'がcellsの"a"であるとする。そして
「dhxWins.attachViewportTo("win");」同時に'win'はdhxWinsにも繋がるようにする。
これでいいみたい
https://dhtmlx.com/docs/products/dhtmlxLayout/samples/07_advanced/01_attach_windows_to_cell.html

最新の60件
2026-10-16 2026-10-12 2026-10-08 2026-10-07 2026-10-06 2026-10-05 2026-10-04 2026-10-02 2026-10-01 2026-09-30 2026-09-28 2026-09-27 2026-09-26 2026-09-22 2026-09-17 2026-09-11 2026-09-06 2026-08-31 2026-08-27 2026-08-24 2026-08-20 2026-08-19 2026-08-18 2026-08-17 2026-08-16 2026-08-15 2026-08-13 2026-08-12 2026-08-11 2026-08-09 2026-07-30 2026-07-25 2026-07-24 2026-07-20 2026-07-18 2026-07-17 2026-07-16 2026-07-08 2026-07-06

edit


トップ   編集 差分 履歴 添付 複製 名前変更 リロード   新規 一覧 検索 最終更新   ヘルプ   最終更新のRSS
Last-modified: 2017-10-18 (水) 03:10:39