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.
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.
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
);
}
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.
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?
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?
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
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
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?