Telerik Forums
UI for PHP Forum
3 answers
100 views

I have a strange issue. I have a grid, with a pop-up editor template, with a boolean field.

This has been working fine until recently, when (I assume after an update to PHP or the MariaDB backend) inserting new records now fails when the checkbox is left unchecked.

After a lot of searching, I found the error message being returned through JSON.

 

It is {"errors":["Incorrect integer value: '' for column 'Read' at row 1"]} . It seems the grid is passing '' instead of 0, for a false value.

If the checkbox is ticked, a new record is inserted without a problem. The issue also affects updates, the checkbox can be ticked, but not unchecked.

The field is defined as a boolean in the model definition:-

$readField = new \Kendo\Data\DataSourceSchemaModelField('Read');
   $readField->type('boolean');

 

And the checkbox is defined as :-

<p><label>Read?:</label><input type="checkbox" name="Read" data-bind="value:Read" > </p>

In the editor template definition

I have tried updating to the latest version of KendoUI, but the problem still persists

The field is a type TinyInt in the database, and is non nullable.

Angel Petrov
Telerik team
 answered on 25 Oct 2018
1 answer
62 views

Hi.

I want to remove the "All day event" and "Repeat" from the event creation/modification, but I'm not able to do it.

If I remove the variables from the examples I end up getting some error messages.

 

Can you tell me if this is achievable?

 

Thank you in advance.

Veselin Tsvetanov
Telerik team
 answered on 01 Aug 2018
4 answers
643 views

HI

I am using renderInTemplate() to nest some widget, in particular, grid inside a window, I discovered the following method is missing to replace # in case the widget is nested inside another and the inner one contains in its definition a template string, so I suggest to patch width in a similar way ( more testing by your side is needed but It permitted to remova a Uncaught Error: Invalid template:' error in my application )

 

     public function renderInTemplate() {
        $this->isClientTemplate = true;
        $output = $this->render();
        $this->isClientTemplate = false;
        $output = str_replace('</script>', '<\\/script>', $output);

        // ADD THIS LINE to Replace also hash to prevent Uncaught Error: Invalid template:'

        return str_replace('#', '\\#', $output);
    }

 

 

Paolo
Top achievements
Rank 1
 answered on 23 Apr 2018
1 answer
232 views

We are having an issue with our grid filtering when it comes to the "Is Null" and "Is Not Null" filters. We are filtering server side via the DataSourceResult.php file, when a column filter is applied with isnull or isnotnull we are getting a mySQL error:

{"error":{"type":"PDOException","message":"SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '?)' at line 1","file":"\/vagrant\/pimcore-root\/website\/lib\/Kendo\/lib\/DataSourceResult.php","line":47}}

 

Filter sent in the request:

 "filter":{"logic":"and","filters":[{"field":"ItemName","operator":"contains","value":"test"},{"field":"IsSpecialPrint","operator":"isnotnull","value":""}]}

 

We're hitting the DataSourceResult result like in the example:

$request = json_decode(file_get_contents('php://input'));
 $result = new DataSourceResult();

Grid datasource JS:

var gridDataSource = new kendo.data.DataSource({
            transport:{
                read:{
                    url: "/gridRead",
                    type: "POST",
                    contentType: "application/json"
                },
                parameterMap: function(data){
                    return kendo.stringify(data);
                },
                prefix: ""
            },
            pageSize: 25,
            page: 1,
            total: 0,
            serverPaging: true,
            serverSorting: true,
            serverFiltering: true,
            serverGrouping: true,
            serverAggregates: true,
            sort: [{
                field: "SKU",
                dir: "asc"
            }],
            schema:{
                data: "data",
                total: "total",
                errors: "errors",
                model: {
                    id: "oo_id",
                    fields: schema
                }
            }
        });

This error seems to occur on all columns regardless if boolean/number/string.Could this be an error within the DataSourceResult.php file filtering logic or something with the encoding of filter values?

We are using version R1 2017.

Thanks.

Stefan
Telerik team
 answered on 09 Mar 2018
1 answer
136 views

Hi, I try to get the data into the grid for short number (9 digit) it display correctly in the grid but when I fetch long number (15 digits) it will display wrong numbers

for example number 200148078262119 will display as 200148078262120 in the grid. I tried to print_r the data from php and the data that php retrieve is correct.

I open up the inspect element in chrome and the jquery .kendoGrid value is scientific notation "2.0014807826212e+14"

May I know is this the culprit for the grid to display incorrect data?

May I know how to solve it?

Stefan
Telerik team
 answered on 08 Mar 2018
5 answers
177 views
I am in need of quarterly and yearly views for my current Scheduler project.  Has anyone created a quarterly timeline view for the PHP UI?  Can you provide an example?
Veselin Tsvetanov
Telerik team
 answered on 09 Feb 2018
3 answers
270 views

I am using PHP wrapper to generate a Kendo UI Grid. But the view factory that I am using use jQuery and other stuff (doesn't matter). So, when I try it to generate a page in the application and add the code that generates Kendo UI Grid. The browser fires an exception because 'jQuery' object doesn't exist. I tried jQuery. (https://api.jquery.com/jquery.noconflict/) API but it didn't work.

Is there an option in Kendo UI wrappers to the symbol or the name that it should use for jQuery?

Dimitar
Telerik team
 answered on 26 Dec 2017
1 answer
86 views

Hi Admins, is there any possible to Colorize Tasks in gantt [PHP] FOR EXAMPLE:

 <script>
      function onDataBound() {
        var gantt = this;

        gantt.element.find(".k-task").each(function(e) {
          var dataItem = gantt.dataSource.getByUid($(this).attr("data-uid"));

          // colorize task per business requirements
          if (dataItem.id = 904) {
            this.style.backgroundColor = "#f99";
          } else {
            this.style.backgroundColor = "#9f9";
          }
        });
      }
</script>

 

But this dosen't work in php gantt, can you please help, and tell what is the way to get colored tasks depending on values for example:

 

$idField = new \Kendo\Data\DataSourceSchemaModelField('id');
$idField->type('number')
        ->from('ID')
        ->nullable(true);

 

Thanks

Veselin Tsvetanov
Telerik team
 answered on 27 Nov 2017
1 answer
4.3K+ views

Hi, can you guys help me to format dates in gantt? If I've saving the times in the database, and there is something like Start - 2017-09-15T22:00:00.000Z, End - 2017-10-21T22:00:00.000Z Is there any way to remove this part of the data? 'T22:00:00.000Z'

I would like to save just only Start - 2017-09-15, End - 2017-10-21
Thanks

Veselin Tsvetanov
Telerik team
 answered on 16 Nov 2017
7 answers
360 views

Hi there, can you guys help my to create select database where.... There is a code that working good.

require_once '../lib/DataSourceResult.php';
require_once '../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('mysql:host=localhost:3306 ;dbname=database_4', 'user', 'password');

    $type = $_GET['type'];

    $operation = $_GET['operation'];

    if ($type == "dependency") {
        $columns = array('ID', 'PredecessorID', 'SuccessorID', 'Type');

        $table = "GanttDependencies";
    } else {
        $columns = array('ID', 'ParentID', 'OrderID', 'name', 'start_date', 'due_date', 'progress', 'Expanded', 'Summary');

        $table = "GanttTasks";
    }

Is there any possible to put there a select with some conditions?

For example I would like to select all the records where id = 10.
Can you help my in this?

Valerius
Top achievements
Rank 1
 answered on 14 Nov 2017
Top users last month
Dominik
Top achievements
Rank 1
Giuliano
Top achievements
Rank 1
Dominic
Top achievements
Rank 1
Glendys
Top achievements
Rank 1
NoobMaster
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?