update or create not working

3 posts, 0 answers
  1. Karamat
    Karamat avatar
    2 posts
    Member since:
    Jun 2017

    Posted 14 Jun 2017 Link to this post

    this is the code that I am using for update or  create but when starting for edit or create and  the bottom name changed to update nothing is working till pressing cancel.

    require_once 'config.php';

    if ($_SERVER['REQUEST_METHOD'] === 'POST') {
        header('Content-Type: application/json');

    $inputJSON = file_get_contents('php://input');
    $paredData = json_decode($inputJSON, TRUE);

    $pn= $paredData["filed1"];
    $sc = $paredData["filed2"];

     * connect to database and execute sqql command
     $tableName = '********'  ;

    $conn = oci_connect($dbuser, $dbpassword , $dbhost.':'.$dbport.'/'.$dbname);        

    $sqlStatement = 'insert into '.$tableName.'(pn, SC) VALUES ('.$PN.', '.$sc.'.');';
    echo $sqlStatement;
    $retrive = oci_parse($conn , $sqlStatement);
    $execute = oci_execute($retrive);

    if ($execute){
        echo 'successful';
        LogerFile($databaseLogEvents,$partNo.' inserted Succesfuly. ');
        } else {
        echo ' error';
        LogerFile($errorLogEvents,$partNo.' has been Rolleback something went wrong for inserting. ');

  2. Karamat
    Karamat avatar
    2 posts
    Member since:
    Jun 2017

    Posted 14 Jun 2017 in reply to Karamat Link to this post

    just forgot to put the grid code.

    $read = new \Kendo\Data\DataSourceTransportRead();

    $update = new \Kendo\Data\DataSourceTransportUpdate();

    $destroy = new \Kendo\Data\DataSourceTransportDestroy();

    $creat = new \Kendo\Data\DataSourceTransportCreate();

    $transport = new \Kendo\Data\DataSourceTransport();
     //       ->parameterMap('mapParamsToJSON');

     *  create data Model 
    $model = new \Kendo\Data\DataSourceSchemaModel();

    $pn= new \Kendo\Data\DataSourceSchemaModelField('PN');

    $sc = new \Kendo\Data\DataSourceSchemaModelField('SC');

    $schema = new \Kendo\Data\DataSourceSchema();


    $dataSource = new \Kendo\Data\DataSource();


    $orderID = new \Kendo\UI\GridColumn();
              //  ->filterable(true)


    $freight = new \Kendo\UI\GridColumn();
    $orderDate = new \Kendo\UI\GridColumn();

    $editCommand = new \Kendo\UI\GridColumnCommandItem();

    $destroycommand = new \Kendo\UI\GridColumnCommandItem();

    $commandColumn  = new \Kendo\UI\GridColumn();
    $create = new \Kendo\UI\GridToolbarItem('create');
    $grid = new \Kendo\UI\Grid('grid');
       //  ->height(750)

    echo $grid->render();



  3. Stefan
    Stefan avatar
    2785 posts

    Posted 16 Jun 2017 Link to this post

    Hello Karamat,

    This is not a known issue and it can be caused by different factors.

    I noticed that the ID field is not created in the DataSourceSchemaModelField.

    Also, in order to help us determine the issue, please advise if there are any errors in the browser console.

    Additionally, I noticed that the Transport create is named $creat, check is setting it to create will change the behaviour.

    Please check our runnable with the Grid with inline editing for the expected configuration:


    If additional assistance is needed, please provide an information about potential errors in the console, and if possible screencast of the issue, so we can investigate further.

    Progress Telerik
    Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Back to Top