Telerik Forums
UI for PHP Forum
1 answer
83 views
Im testing several frameworks and i realy liked TELERIK PHP UI but the examples were not very clear about how telerik manages the data returned by the server.
Do i need to write the classes that will run a select on the dabase and provide the results for the telerik controlers or telerik already has something like this?

basically i need to create this 2 examples using telerik the simplest way possible whitout writing the business rules. 

https://demos.devexpress.com/ASP/Performance/
https://demos.devexpress.com/ASPxGridViewDemos/DataBinding/LinqDataSourceServerMode.aspx
Nikolay Rusev
Telerik team
 answered on 11 Sep 2015
1 answer
99 views

How set culture for grid

This not working:

<script type="text/javascript">
    kendo.culture("ro-RO");
</script>​

Atanas Georgiev
Telerik team
 answered on 11 Aug 2015
1 answer
78 views

Hello everybody,

I'm new with Kendo, I'm trying to create one grid that receiving data from couple of mysql tables(3-5 tables)(simple mysql select - join statement).

I thought that "readJoin" should be the answer for my question, but I could not find any detail on this function.

I hope someone could lead me to the answer.

Thank you very much.

Nitay.

Alexander Valchev
Telerik team
 answered on 28 May 2015
2 answers
225 views

Hi.

We have a Kendo Grid with the Filter Row activated (using Kendo UI PHP), the web page has the Spanish culture loaded so date formats are shown in Spanish.

One of the Grid columns is a date created with ->format('{0:dd/MM/yyyy}', this shows all dates in Spanish format on the Grid and New/Update forms as expected.

The Grid Filter Row command ->mode("row"); on the other hand creates a date picker with the default date format MM/dd/yyyy thus using a different format to filter the column.

If the users picks a date from the mini calendar, the filter works as expected (although it shows the date in a different format than the Grid). On the other hand if they type it in manually using the format shown in the Grid the filter does not work as they have used the wrong format for the field.

 Any ideas on how to get a Filter Row date picker created in PHP to accept the culture loaded in the page?

 Regards

 Michael Mc Cudden

Michael
Top achievements
Rank 1
 answered on 21 May 2015
1 answer
104 views

Hi, I used the sample code for inline editing and just change some parameters but the gird doesn't populate any data. Can you help help me ?

This is my code:

<!DOCTYPE html>
<html>
<head>
    <title></title>
    <link rel="stylesheet" href="styles/kendo.common.min.css" />
    <link rel="stylesheet" href="styles/kendo.default.min.css" />
    <link rel="stylesheet" href="styles/kendo.dataviz.min.css" />
    <link rel="stylesheet" href="styles/kendo.dataviz.default.min.css" />
 
    <script src="js/jquery.min.js"></script>
    <script src="js/kendo.all.min.js"></script>
</head>
<body>
<?php
require_once 'includes/lib/DataSourceResult.php';
require_once 'includes/lib/Kendo/Autoload.php';
 
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
    header('Content-Type: application/json');
 
    $request = json_decode(file_get_contents('php://input'));
 
    $result = new DataSourceResult('');
 
    $type = $_GET['type'];
 
    $columns = array('ID', 'Control_Name', 'English_Description' );
 
    switch($type) {
        case 'create':
            $result = $result->create('controls_name', $columns, $request->models, 'ID');
            break;
        case 'read':
            $result = $result->read('controls_name', $columns, $request);
            break;
        case 'update':
            $result = $result->update('controls_name', $columns, $request->models, 'ID');
            break;
        case 'destroy':
            $result = $result->destroy('controls_name', $request->models, 'ID');
            break;
    }
 
    echo json_encode($result, JSON_NUMERIC_CHECK);
 
    exit;
}
 
$transport = new \Kendo\Data\DataSourceTransport();
 
$create = new \Kendo\Data\DataSourceTransportCreate();
 
$create->url('kendoTest2.php?type=create')
    ->contentType('application/json')
    ->type('POST');
 
$read = new \Kendo\Data\DataSourceTransportRead();
 
$read->url('kendoTest2.php?type=read')
    ->contentType('application/json')
    ->type('POST');
 
$update = new \Kendo\Data\DataSourceTransportUpdate();
 
$update->url('kendoTest2.php?type=update')
    ->contentType('application/json')
    ->type('POST');
 
$destroy = new \Kendo\Data\DataSourceTransportDestroy();
 
$destroy->url('kendoTest2.php?type=destroy')
    ->contentType('application/json')
    ->type('POST');
 
$transport->create($create)
    ->read($read)
    ->update($update)
    ->destroy($destroy)
    ->parameterMap('function(data) {
              return kendo.stringify(data);
          }');
 
$model = new \Kendo\Data\DataSourceSchemaModel();
 
$IDField = new \Kendo\Data\DataSourceSchemaModelField('ID');
$IDField->type('number')
    ->editable(false);
    //->nullable(true);
 
$controlNameField = new \Kendo\Data\DataSourceSchemaModelField('Control_Name');
$controlNameField->type('string');
  //  ->validation(array('required' => true));
 
$model->id('ID')
    ->addField($IDField)
    ->addField($controlNameField);
 
$schema = new \Kendo\Data\DataSourceSchema();
$schema->data('data')
    ->errors('errors')
    ->model($model)
    ->total('total');
 
$dataSource = new \Kendo\Data\DataSource();
 
$dataSource->transport($transport)
    ->batch(true)
    ->pageSize(20)
    ->schema($schema);
 
$grid = new \Kendo\UI\Grid('grid');
 
$controlName = new \Kendo\UI\GridColumn();
$controlName->field('Control_Name')
    ->title('Control Name');
 
$command = new \Kendo\UI\GridColumn();
$command->addCommandItem('edit')
    ->addCommandItem('destroy')
    ->title(' ')
    ->width(172);
 
$grid->addColumn($controlName, $command)
    ->dataSource($dataSource)
    ->addToolbarItem(new \Kendo\UI\GridToolbarItem('create'))
    ->height(430)
    ->editable('inline')
    ->pageable(true);
 
echo $grid->render();
?>
 
 
</body>
</html>

Alexander Popov
Telerik team
 answered on 07 Apr 2015
0 answers
69 views
I have some issues when exporting the telerik report to excel at browser, the page take long time to load and the result crushed. 

There telerik have limitation to export data? I exporting for 80k data rows, sometime more than that data.
Devan
Top achievements
Rank 1
 asked on 27 Mar 2015
1 answer
85 views
In the grids examples (popup editing) I found this code but I dont know why it used like that please explain.

if
($_SERVER['REQUEST_METHOD'] == 'POST') {
    header('Content-Type: application/json');
 
    $request = json_decode(file_get_contents('php://input'));
DavidOBrien
Top achievements
Rank 2
 answered on 24 Mar 2015
3 answers
67 views
When I add a new record to the detail grid in a master/detail grid, I see an ajax call for each exisitng record: ie, if there are 4 records already in the detail grid then there will be 5 posts to the new datail method followed by 5 calls to the show details method. This seems to be both unneccessary and a waste of my server resources. I also have to test for an existing detailId before attempting the insert into the database so that I do not get duplicate records in the databse.

How can I limit it to just the one insert call for the new record followed by just one grid refresh call.

Here is my js event handler for the grid edit event:
/**
 * edit event handler of the curent comments grid.
 * Bound at design time by the grid configuration.
 *
 * @param {event} e
 */
function commentsEdit(e) {
    if (e.model.isNew()) {
        /**
         * get the participant_hotalert_id from parentData and set it into the model
         */
        e.model.set('participant_hotalert_id', parentData.participant_hotalert_id);
        /**
         * get the current status from parentData and set the status of the new comment.
         * N.B.
         * You have to set the popup window element first or you CANNOT set the value in the model.
         * Both have to be set so that the new comment gets the current status when the user does not change it.
         */
        var status = parentData.status;
        e.container.find('select').val(status);
        e.model.set('status', status);
    }
}
Vladimir Iliev
Telerik team
 answered on 26 Feb 2015
3 answers
103 views
I tried the popup edit example of the Grid exactly like in the example code but when I try it I get unresponsive page error in Chrome. In FireFox the grid loaded but slowly.
here is the example I talking about.
http://demos.telerik.com/php-ui/grid/editing-popup


Vladimir Iliev
Telerik team
 answered on 25 Feb 2015
2 answers
77 views
First I must say that there is a lack of dicomentation explaing what the $properties input variable is: I just took a guess that it was the schema model fields list.

Anyway, there is a serious bug in your code, a complete lack of understanding about the behaviour of certain php functions and consequently the misuse of them: viz:

// line 277
            if (isset($properties[$field])) {
                $type = $properties[$field]['type'];
            } else if ($this->isDate($filter->value)) {
                $type = "date";
            } else if (array_key_exists($filter->operator, $this->operators) && !$this->isString($filter->value)) {
                $type = "number";
            }
 
 
    private function isDate($value)
    {
        $result = date_parse($value);
        return $result["error_count"] < 1 && checkdate($result['month'], $result['day'], $result['year']);
    }
 
You are using parse_date to test if a value is a date. NOT what it is intended for: all sorts of non-dates can be parsed into a date when they are not. It is the same as Excel converting phone numbers into dates: completely stupid.

In our case the STRING '012487377/1' is evaluated as a DATE and the code fails

ContextErrorException: Notice: Undefined index: startswith in C:\Development\dlg\src\TLF\PortalBundle\Services\DataSourceResultService.php line 294<br>

 Now I will be fixing the code locally by elliminating that set of test all together. I will specify the data type in the properties array since I designed the grid and I know what the data types are. I would expect that this is the case for 99.9% of developers using your code. Please fix the code at your end so that this does not trip other people up.
Leader
Top achievements
Rank 1
 answered on 20 Feb 2015
Top users last month
Mark
Top achievements
Rank 1
Yurii
Top achievements
Rank 1
Leland
Top achievements
Rank 2
Iron
Iron
Iron
Hon
Top achievements
Rank 1
Iron
Deltaohm
Top achievements
Rank 3
Bronze
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?