We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

How to configure the localization of the PHP grid????

<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

<!-- Essential Studio for JavaScript theme reference -->

<link rel='nofollow' href="themes/default-theme/ej.web.all.min.css" rel="stylesheet" />

<!-- Essential Studio for JavaScript script references -->

<script src="scripts/external/jquery-3.1.1.min.js"></script>

<script src="scripts/external/jsrender.min.js"></script>

 <script src="scripts/i18n/ej.culture.ru-RU.min.js"></script>
    <script src="scripts/l10n/ej.localetexts.ru-RU.min.js"></script>



<script src="scripts/web/ej.web.all.min.js"> </script>

<!-- Add your custom scripts here -->
    </head>
<body>
<?php
require_once 'Src/AutoLoad.php';
?>
<div class="cols-sample-area">
    <?php
// setlocale(LC_ALL, 'ru_RU.utf8');
   // Header("Content-Type: text/html;charset=UTF-8");
  //  $Json = json_decode(file_get_contents("data.json"), true);
$items = array(
array(
"OrderID"=> 10,
    "CustomerID"=>  "ВАСЯ"),
array(
"OrderID"=> 20,
    "CustomerID"=>  "Петя ") 
     
);
$Json = $items;//json_decode(json_encode($items), true);

echo '<pre>'.print_r($Json, true).'</pre>';
//echo ($Json);
    $col1 = new EJ\Grid\Column("locale");
    $col1->field("OrderID")->headerText("OrderID")->textAlign("right")->isPrimaryKey(true)->width(100);
    $col2 = new EJ\Grid\Column();
    $col2->field("CustomerID")->headerText('CustomerID')->textAlign('right')->format('{0:C}')->width(70);
  /*  $col3 = new EJ\Grid\Column();
    $col3->field("EmployeeID")->headerText("EmployeeID")->textAlign("right")->width(70);
    $col4 = new EJ\Grid\Column();
    $col4->field("ShipCountry")->headerText("ShipCountry")->width(70);
    $col5 = new EJ\Grid\Column();
    $col5->field("Freight")->headerText("Freight")->textAlign("right")->format("{0:C}")->width(70);*/
    $gridColumns = array($col1,$col2/*,$col3,$col4,$col5*/);
    $grid =  new EJ\Grid("Grid");
    $edit =new EJ\Grid\EditSetting();
    $toolbarItems = array("add","edit","delete","update","cancel");
    $toolbar= new EJ\Grid\ToolbarSetting();
    echo $grid ->locale("ru-RU") -> dataSource($Json) -> allowPaging(true)->columns($gridColumns)->editSettings($edit->allowEditing(true)->allowDeleting(true)->allowAdding(true))->toolbarSettings($toolbar->showToolbar(true)->toolbarItems($toolbarItems))->render();
    ?>

</div>
</body>


Attachment: im_ERR_798444d2.rar

2 Replies

DA dan April 6, 2017 06:41 AM UTC

I find problem with encodin UTF-8 with russian sumbol

like file SERIALIZE.PHP serch json_encode

add  param   JSON_UNESCAPED_UNICODE

 json_encode($array, JSON_UNESCAPED_UNICODE)


TS Thavasianand Sankaranarayanan Syncfusion Team April 7, 2017 11:03 AM UTC

Hi Dan. 
 
We noticed that you have created an incident for the same query under your Direct-trac. Please follow-up with the incident for further assistance. 
 
 
Regards, 
Thavasianand S. 


Loader.
Up arrow icon