Telerik Forums
UI for PHP Forum
1 answer
149 views

Hello,

i need add a button and my self code in toolbar it's possible ?

Thinkyou

Larbi
Top achievements
Rank 1
 answered on 08 Mar 2021
2 answers
179 views

HI 

  I use the official Remote Binding example,But with no results returned, I get an empty GRID. could you help me to check my code?  I'm sure there is no problem with JSON-Returning File Test02.php. It can return JSON results。

 
li
Top achievements
Rank 1
 answered on 03 Mar 2021
5 answers
1.3K+ views
This is not so much a question, but more tip for those looking to do the same.

I'm usiing Kendo + PHP Wrappers in various projects and for all my new projects I have started using composer as an easy way to reuse code and pull in external libraries. The only frustration I had was that I couldn't use this method to pull in the Kendo library.

So I decided to create my own little composer package, which is basically just a wrapper for the entire Kendo library. It contains both the PHP files and the js/css files.

For my most recent project I am using the Laravel 4 Framework (awesome, check it out: laravel.com), so my package is focused on Laravel, but really it should work for all frameworks (no laravel dependencies).

Since Kendo PHP is not open source, I could not simply create a github project and be done with it. Instead I set up a private Composer repository using Satis, using this tutorial: composer/satis tutorial

That was fairly straightforward and easy to do. To host the library, I created a private subversion repository on my private server (I'll be migrating everything to git once I have more time...) which contains the kendo js, css and php files.

The next step was to make sure that when I include the Kendo Composer package, the Composer Autoload function works as expected. To make that work, I had to add the following section to my composer.json file:
"autoload": {
    "classmap": [
        "src/Kendoui/lib"
    ]
}
This will ensure that whenever composer updates or installs, it scans the entire library folder and generates a classmap for autoloading. You won't have to manually include any more classes and when the Kendo library is updated, a simple composer update should do the trick for you.

I just thought I'd share this with everyone in case people are trying to do the same. If you would like to get a similar setup and run into issues, I'm more than happy to help! :)

Regards,
Rinck
Martin
Telerik team
 answered on 18 Aug 2020
2 answers
126 views

Hi,

I use kendo diagram. There is a problem about HierarchicalDataSource that does not make a request to API to update of itself.

There is an example of the code on the below;


$transport = new \Kendo\Data\DataSourceTransport();
 
$create = new \Kendo\Data\DataSourceTransportCreate();
 
$create->url('/Api/Json/Security/Create?_token='.csrf_token())
    ->contentType('application/json')
    ->dataType("JSONP")
    ->type('POST');
 
$read = new \Kendo\Data\DataSourceTransportRead();
 
$read->url('/Api/Json/Security/Read?_token='.csrf_token())
    ->contentType('application/json')
    ->dataType("JSONP")
    ->type('POST');
 
$update = new \Kendo\Data\DataSourceTransportUpdate();
 
$update->url('/Api/Json/Security/Update?_token='.csrf_token())
    ->contentType('application/json')
    ->dataType("JSONP")
    ->type('POST');
 
$destroy = new \Kendo\Data\DataSourceTransportDestroy();
 
$destroy->url('/Api/Json/Security/Delete?_token='.csrf_token())
    ->contentType('application/json')
    ->dataType("JSONP")
    ->type('POST');
 
$transport->create($create)
    ->read($read)
    ->update($update)
    ->destroy($destroy)
    ->parameterMap('function(data) {
      return kendo.stringify(data);
  }');
 
$model = new \Kendo\Data\HierarchicalDataSourceSchemaModel();
$model->id("Id")
    ->addField("Title")
    ->addField("Type")
    ->addField("ParentId")
    ->children("items");
 
$schema = new \Kendo\Data\HierarchicalDataSourceSchema();
$schema->model($model);
 
$dataSource = new \Kendo\Data\HierarchicalDataSource();
$dataSource->transport($transport)
    ->requestEnd('reDesign')
    ->batch(true)
    ->schema($schema);
 
$layout = new \Kendo\Dataviz\UI\DiagramLayout();
$layout->type('tree')
    ->subtype('down')
    ->horizontalSeparation(100)
    ->verticalSeparation(50);
 
 
$shapeContent = new \Kendo\Dataviz\UI\DiagramShapeDefaultsContent();
 
 
$shape_defaults = new \Kendo\Dataviz\UI\DiagramShapeDefaults();
$shape_defaults->visual(new \Kendo\JavaScriptFunction('visualTemplate'))
    ->content($shapeContent);
 
$stroke = new \Kendo\Dataviz\UI\DiagramConnectionDefaultsStroke();
$stroke->color('#586477')
    ->width(2);
 
$connection_defaults = new \Kendo\Dataviz\UI\DiagramConnectionDefaults();
$connection_defaults->stroke($stroke)
    ->selectable(false);
 
$diagram = new \Kendo\Dataviz\UI\Diagram('diagram');
$diagram->dataSource($dataSource)
    //->connectionsDataSource()
    ->layout($layout)
    ->editable(array("drag" => false, "resize" => false,
        "tools" => (array) array(
            array("name" => "createShape"),
            array("name" => "edit"),
            array("name" => "delete"),
            array("type" => "button", "text" => "Resim", "click" => new \Kendo\JavaScriptFunction('function(e) { exportImg() }')),
            array("type" => "button", "text" => "PDF", "click" => new \Kendo\JavaScriptFunction('function(e) { exportPdf() }')),
            array("type" => "button", "text" => "SVG", "click" => new \Kendo\JavaScriptFunction('function(e) { exportSvg() }')),
        ),
        "shapeTemplate" => new \Kendo\JavaScriptFunction('kendo.template(
                "<div class=\"k-edit-label\"><label>Başlık</label></div>" +
                "<div class=\"k-edit-field\"><input class=\"k-textbox\" type=\"text\" name = \"Title\" id=\"Title\"/></div>" +
                "<div class=\"k-edit-label\"><label>İş Grubu</label></div>" +
                "<div class=\"k-edit-field\"><input type=\"checkbox\" class=\"k-checkbox\" name = \"Type\" id=\"Type\"/></div>" +
                "<div class=\"k-edit-label\"><label>Bağlı Departman</label></div>" +
                "<div class=\"k-edit-field\"><input id=\"ParentId\" name = \"ParentId\"/></div>")')
    ))
    ->dataBound('onDataBound')
    ->shapeDefaults($shape_defaults)
    ->addEvent('dp')
    ->edit('dp')
    ->select('function(e) {
        $.each(e.selected, function($k, $v){
            if(typeof($v.type) == "function"){
                console.log($v);
            }
        });
         
    }')
    ->connectionDefaults($connection_defaults);
 
 
 
$render = $diagram->render();
 $results = array("Render" => $render);
 
return response()->JSON($results);
marksist
Top achievements
Rank 1
 answered on 17 Aug 2020
7 answers
115 views

Is it possible to display cards in grid?

Example:

- Have a 8 x 8 grid. 

- Several cards displayed vertically in each cell.

- Ability to drag cards between cells

Martin
Telerik team
 answered on 13 Aug 2020
1 answer
80 views

Hello!

I'm facing with a problem right now. 

I tried to add the legend for the pie and the donut, but unfortunately it doesn't work.

My first try was to add legend inside of chart like example below:

$chart = new \Kendo\Dataviz\UI\Chart('chart');
        $chart->dataSource($dataSource)
            ->autoBind(TRUE)
            ->tooltip($tooltip)
            ->addSeriesItem($seriesPieDonut)
            ->legend(array('visible' => true))
            ->seriesDefaults($seriesDefaults);

Also my second try was to add the legend into series like example below:

$seriesPieDonut = new \Kendo\Dataviz\UI\ChartSeriesItem();
        $seriesPieDonut->field('datapoint')->visibleInLegend('visible');

 

Unfortunately the result is the same.

Maybe you guys have a solution for thins situation. I will greatly appreciate! 

Thank you!

Yours,

Alexandru-Paul Ioneasa

Tsvetomir
Telerik team
 answered on 05 Dec 2019
6 answers
260 views

Guys are you able to help me to hide/disable just a popup box when double click on tasks? http://demos.telerik.com/php-ui/gantt/index
I could add->editable(false); just below:

 

[code]// gantt $gantt = new \Kendo\UI\Gantt('gantt'); $gantt->dataSource($tasks)->dependencies($dependencies)->height(650)->addView('', array('type' => 'week', 'selected' => false),'month')->addColumn($idColumn, $titleColumn, $startColumn, $endColumn)->showWorkHours(false)->showWorkDays(true)->snap(false)->editable(false);[/code]

 

But then I cannot edit anything.
Any clue? Thanks.

Ben
Top achievements
Rank 1
 answered on 04 Nov 2019
1 answer
50 views

Hi ,

Can any one help me how to show  all days in month view of gantt chart . I am using php

Dimitar
Telerik team
 answered on 13 Jun 2019
3 answers
115 views

 

This file is included in the latest version of the UI for PHP source file (telerik.ui.for.php.2017.1.223.commercial-source.zip), and has an invalid classname with a period. This just needs to be removed from the package because there is /DiagramConnectionDefaultsEndCapStroke.php in the same folder and same methods, with correct classname.

 

Konstantin Dikov
Telerik team
 answered on 10 May 2019
3 answers
103 views

There should be an open event for the mobile actionsheet (according to the docs at: https://docs.telerik.com/kendo-ui/api/javascript/mobile/ui/actionsheet/events/open ) but looks like it never fires.

 

The code needs one additional line to trigger the event:

kendo.mobile.ui.ActionSheet.prototype.open = function(target, context) {
            var that = this;
            that.target = $(target);
            that.context = context;
            that.shim.show(target);
    that.trigger('open', { target: target, context: context }); /* trigger open event*/

        };

Dimitar
Telerik team
 answered on 19 Apr 2019
Top users last month
Dominik
Top achievements
Rank 1
Giuliano
Top achievements
Rank 1
Dominic
Top achievements
Rank 1
Glendys
Top achievements
Rank 1
Iron
NoobMaster
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?