Hi,
I have been struggling with this for days and cannot figure it out - any help would be greatly appreciated!
I am creating a UI Grid with php wrappers where I am trying to read & update data to/from a database stored in MySQL.
The reading part is working just fine - but when I try to post, I keep getting error. The reason is that the "$columnName = mysql_real_escape_string($_POST["fieldname"]);" commands are not returning anything in my database connection file.
Perhaps it is because I am batch editing so it is not posting 1 single field value but instead an array of them?
Here is my code:
MAIN PHP FILE:
<?php
require_once '../lib/DataSourceResult.php';
require_once '../lib/Kendo/Autoload.php';
$transport = new \Kendo\Data\DataSourceTransport();
$read = new \Kendo\Data\DataSourceTransportRead();
$read->url('data/connection2.php?type=get')
->contentType('application/json')
->type('GET'); //corresponds to "verb" in connection2.php
$update = new \Kendo\Data\DataSourceTransportUpdate();
// Specify the url of the PHP page which will update the bank table
$update->url('data/connection2.php?type=update')
->contentType('application/json')
->type('POST'); //corresponds to "verb" in connection2.php
$transport ->read($read)
->update($update)
->parameterMap('function(data) {
return kendo.stringify(data);
}');
$model = new \Kendo\Data\DataSourceSchemaModel();
$FirstNameField = new \Kendo\Data\DataSourceSchemaModelField('First');
$FirstNameField->type('string');
$LastNameField = new \Kendo\Data\DataSourceSchemaModelField('Last');
$LastNameField->type('string');
$idField = new \Kendo\Data\DataSourceSchemaModelField('id');
$idField->type('number');
$model->id('id')
->addField($FirstNameField)
->addField($LastNameField)
->addField($idField);
$schema = new \Kendo\Data\DataSourceSchema();
$schema->data('data')
->model($model);
$dataSource = new \Kendo\Data\DataSource();
$dataSource->transport($transport)
->pageSize(50)
->serverPaging(false)
->batch(true) //batch editing
->schema($schema);
$grid = new \Kendo\UI\Grid('grid');
$First = new \Kendo\UI\GridColumn();
$First->field('First')
->title('First Name')
->width(150);
$Last = new \Kendo\UI\GridColumn();
$Last->field('Last')
->title('Last Name')
->width(250);
$grid->addColumn($First, $Last)
->addToolbarItem(new \Kendo\UI\GridToolbarItem('save'), new \Kendo\UI\GridToolbarItem('cancel'))
->dataSource($dataSource)
->pageable($pageable)
->editable(true)
->navigatable(true)
->attr('style', 'height:550px');
?>
<?php
echo $grid->render();
?>
AND HERE IS THE CONNECTION file (connection2.php)
((Note the error is happening with $myID & $myLastName..the values are not actually being passed in (they are displaying as empty when I echo these variables) so I suspect that is the root cause why the data is not being posted to my database. This means "id" & "Last" are not getting passed into the connection file properly for all the records I am attempting to batch edit.
<?php
$link = mysql_connect("localhost", "myusername", "mypassword') or die("Unable To Connect To Database Server");
mysql_select_db("mydb") or die("Unable To Connect To My DB");
$verb = $_SERVER["REQUEST_METHOD"];
// handle a GET
if ($verb == "GET") {
$arr = array();
$rs = mysql_query("SELECT * FROM mytable");
ini_set('memory_limit', '-1');
while($obj = mysql_fetch_object($rs)) {
$arr[] = $obj;
}
header('Content-Type: application/json');
echo "{\"data\":" .json_encode($arr). "}";
}
// handle a POST
if ($verb == "POST") {
$myID = mysql_real_escape_string($_POST["id"]);
$myLastName = mysql_real_escape_string($_POST["Last"]);
$rs = mysql_query($link,"UPDATE mytable SET Last= '" .$myLastName ."' WHERE id = " .$myID);
if ($rs) {
echo json_encode($rs);
}
else {
header("HTTP/1.1 500 Internal Server Error");
echo "Update failed for ID: " .$myID;
}
}
?>
Hello,
I'm using kendo.dataviz.diagram.Layout to handle text overflow in diagram shapes, but sometimes that is not enough, and the text overflows vertically. I want to identify this problem and solve it by changing my shape's height to fit this, so I need a way to ask the Layout what is it's preferred height (or number of lines, etc).
I currently have something like this:
var layout = new kendo.dataviz.diagram.Layout( new kendo.dataviz.diagram.Rect(shape.contentX, shape.contentY, shape.contentWidth, shape.contentHeight), { alignContent: "center", justifyContent: "center", spacing: 6, lineSpacing: 5 }); var texts = entity.name.split(" "); for (var i = 0; i < texts.length; i++) { layout.append(new kendo.dataviz.diagram.TextBlock({ text: texts[i] })); } layout.reflow(); var path = new kendo.dataviz.diagram.Path({ data: shape.path, stroke: stroke, fill: fill, height: Math.max(shape.contentHeight+10, layout.rect().height+10) });The idea being that I have the default (shape.contentHeight) height, and if the layout height exceeds it I increase the Path height, but sadly Layout.rect() always returns the initial rectangle.
Is there a way to query the layout for the actual ("preferred") rectangle size, or at least know if it exceeded the originally allocated one?
Thanks.
Example: http://dojo.telerik.com/ipura
Is it possible to have the tooltip for a plot point on a line chart show only when the mouse is directly over that point on the x axis. If you look at the example link, when you hover over the first point, it shows the tooltip. However, the tooltip does not disappear as you move tho the right. When you get to the point that is in the gap, the tooltip bounces from the first point to the third depending on which side the mouse is on.
Is there a solution to this? The sparkline seems to do this correctly. When I hover over a gap on the sparkline, the tooltip disappears.
Hello,
I have a problem with DropDownList. If you try to open ddl, filter by "me", select it and then click button "clickme" the newly added item isnt selected.
Example:
http://dojo.telerik.com/exazO/4

We are testing the insert table functionality in the editor. When we add the table it has certain default styling. It looks like the attached file.
When we clear formatting it looks like this.
1 2
when we save it it saves with no styling.
<table>
<tbody>
<tr>
<td>1</td>
<td>2</td>
</tr>
</tbody>
</table>
But when we return to the editor and reload the saved table it gets the default styling and shows like the attached file. Is there something we should be doing to save the styling?

How do you add a separator to the Toolbar?
Thanks,
Reid
I use Bootstrap + Kendo UI as explained here http://docs.telerik.com/kendo-ui/third-party/using-kendo-with-twitter-bootstrap.
However, when I include the Bootstrap css, it shifts the items in k-window-titlebar slightly lower which doesn't look very good.
You can seen the effect in this Kendo UI Dojo: http://dojo.telerik.com/apeWu
Could you please provide a workaround or fix?
