Telerik Forums
UI for PHP Forum
4 answers
356 views

I'm just starting a project using PHP, rather than my more familiar ASP.NET MVC.

I'm trying to get a grid with a pop-up editor working, containing a field bound to a drop-down list. I've (finally) got this working, but even though I've added the required validation to the field, and the field in the table is not nullable, the form is still allowing blank entries, which are populated as ''.

The field is defined as:-

$monthField = new \Kendo\Data\DataSourceSchemaModelField('Month');
   $monthField->type('string')
   ->validation(array('required'=>true));

 

The column is :-

$monthColumn = new \Kendo\UI\GridColumn();
                 $monthColumn->field('Month')
                              ->editor('monthDropDownEditor');

 

and the validator is set up as:-

function monthDropDownEditor(container, options) {
    $('<input data-text-field="Month" data-value-field="Month" data-bind="value:' + options.field + '"/>')
        .appendTo(container)
        .kendoDropDownList({
            autoBind: false,
            dataSource: {
                schema: {
                    data: "data"
                },
                transport: {
                    read: {
                        url: "dataSourceMonths.php?type=read",
                        type: "POST",
                        dataType: "json"
                    }
                }
            },
            
            optionLabel: "Select month...",
        });
    }

 

What do I need to do to make this a required field, and pop-up a validation message?

Thanks

AP
Top achievements
Rank 1
Iron
Iron
Veteran
 answered on 24 Aug 2017
1 answer
64 views
How to create title of Header Row Multicolumn Alignment At of The Middle Merge Rows. See Picture
Boyan Dimitrov
Telerik team
 answered on 14 Aug 2017
1 answer
185 views

Hi,

We use the Excel export feature of your component.

In the export I have few cells that contains multi-line text.

In the exported file, the line height is set to the default value.

Is it possible to set the line height to some kind of "auto" to fit the content and expand if necessary ?

Best regards

Emmanuel

Stefan
Telerik team
 answered on 12 Jul 2017
1 answer
111 views

Hi,

I have tried the example of information retrieve from database and show in grid.But failed

json outputs coming properly. See below. but not showing data in grid.Find attached files of code used php.

[{"id":"38","employee_no":"EMP1","firstname":"prajakta","middlename":"prakash","lastname":"dhanke","email":"pdhanke@gmail.com","dob":"0000-00-00 00:00:00","image":"image.jpg","is_active":"1","is_deleted":null,"created_date":"2017-06-12 13:55:33.000000","edited_date":null,"deleted_date":null},{"id":"39","employee_no":"EMP1","firstname":"prajakta","middlename":"prakash","lastname":"dhanke","email":"pdhanke@gmail.com","dob":"0000-00-00 00:00:00","image":"image.jpg","is_active":"1","is_deleted":null,"created_date":"2017-06-12 13:56:10.000000","edited_date":null,"deleted_date":null},{"id":"40","employee_no":"EMP1","firstname":"prajakta","middlename":"prakash","lastname":"dhanke","email":"pdhanke@gmail.com","dob":"0000-00-00 00:00:00","image":"image.jpg","is_active":"1","is_deleted":null,"created_date":"2017-06-12 13:58:44.000000","edited_date":null,"deleted_date":null},{"id":"41","employee_no":"EMP41","firstname":"mohini","middlename":"vishal","lastname":"patil","email":"pmohini@gmail.com","dob":"1995-11-11 00:00:00","image":"image.jpg","is_active":"0","is_deleted":"0","created_date":"0000-00-00 00:00:00.000000","edited_date":"2017-06-13 09:11:13.000000","deleted_date":"0000-00-00 00:00:00.000000"},{"id":"42","employee_no":"EMP1","firstname":"prajakta","middlename":"prakash","lastname":"dhanke","email":"pdhanke@gmail.com","dob":"0000-00-00 00:00:00","image":"image.jpg","is_active":"1","is_deleted":null,"created_date":"2017-06-12 13:59:02.000000","edited_date":null,"deleted_date":null},{"id":"43","employee_no":"EMP1","firstname":"prajakta","middlename":"prakash","lastname":"dhanke","email":"pdhanke@gmail.com","dob":"0000-00-00 00:00:00","image":"image.jpg","is_active":"1","is_deleted":null,"created_date":"2017-06-12 13:59:20.000000","edited_date":null,"deleted_date":null},{"id":"44","employee_no":"EMP1","firstname":"prajakta","middlename":"prakash","lastname":"dhanke","email":"pdhanke@gmail.com","dob":"0000-00-00 00:00:00","image":"image.jpg","is_active":"1","is_deleted":null,"created_date":"2017-06-12 14:00:53.000000","edited_date":null,"deleted_date":null},{"id":"45","employee_no":"EMP1","firstname":"prajakta","middlename":"prakash","lastname":"dhanke","email":"pdhanke@gmail.com","dob":"0000-00-00 00:00:00","image":"image.jpg","is_active":"1","is_deleted":null,"created_date":"2017-06-12 14:02:13.000000","edited_date":null,"deleted_date":null},{"id":"46","employee_no":"EMP1","firstname":"prajakta","middlename":"prakash","lastname":"dhanke","email":"pdhanke@gmail.com","dob":"0000-00-00 00:00:00","image":"image.jpg","is_active":"1","is_deleted":null,"created_date":"2017-06-12 14:10:54.000000","edited_date":null,"deleted_date":null},{"id":"47","employee_no":"EMP1","firstname":"prajakta","middlename":"prakash","lastname":"dhanke","email":"pdhanke@gmail.com","dob":"0000-00-00 00:00:00","image":"image.jpg","is_active":"1","is_deleted":null,"created_date":"2017-06-12 14:12:29.000000","edited_date":null,"deleted_date":null},{"id":"48","employee_no":"EMP1","firstname":"prajakta","middlename":"prakash","lastname":"dhanke","email":"pdhanke@gmail.com","dob":"0000-00-00 00:00:00","image":"image.jpg","is_active":"1","is_deleted":null,"created_date":"2017-06-12 14:13:22.000000","edited_date":null,"deleted_date":null},{"id":"49","employee_no":"EMP1","firstname":"prajakta","middlename":"prakash","lastname":"dhanke","email":"pdhanke@gmail.com","dob":"0000-00-00 00:00:00","image":"image.jpg","is_active":"1","is_deleted":null,"created_date":"2017-06-12 14:35:09.000000","edited_date":null,"deleted_date":null},{"id":"50","employee_no":"EMP1","firstname":"prajakta","middlename":"prakash","lastname":"dhanke","email":"pdhanke@gmail.com","dob":"0000-00-00 00:00:00","image":"image.jpg","is_active":"1","is_deleted":null,"created_date":"2017-06-12 14:56:16.000000","edited_date":null,"deleted_date":null},{"id":"51","employee_no":"EMP41","firstname":"mohini","middlename":"vishal","lastname":"patil","email":"pmohini@gmail.com","dob":"1995-11-11 00:00:00","image":"image.jpg","is_active":"0","is_deleted":null,"created_date":"0000-00-00 00:00:00.000000","edited_date":null,"deleted_date":null},{"id":"52","employee_no":"EMP41","firstname":"mohini","middlename":"vishal","lastname":"patil","email":"pmohini@gmail.com","dob":"1995-11-11 00:00:00","image":"image.jpg","is_active":"1","is_deleted":null,"created_date":null,"edited_date":"2017-06-13 07:28:13.000000","deleted_date":null},{"id":"53","employee_no":"EMP41","firstname":"mohini","middlename":"vishal","lastname":"patil","email":"pmohini@gmail.com","dob":"1995-11-11 00:00:00","image":"image.jpg","is_active":"1","is_deleted":null,"created_date":null,"edited_date":"2017-06-13 08:44:14.000000","deleted_date":null}]

 

Thank you.

Preslav
Telerik team
 answered on 26 Jun 2017
2 answers
130 views

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.

<?php
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';
    oci_commit($conn);
    LogerFile($databaseLogEvents,$partNo.' inserted Succesfuly. ');
    } else {
    echo ' error';
    oci_rollback($conn);
    LogerFile($errorLogEvents,$partNo.' has been Rolleback something went wrong for inserting. ');
    }

Stefan
Telerik team
 answered on 16 Jun 2017
2 answers
149 views

Hi,

I use the DataSourceResult as the datasource of my grid.

But DateTime are not inserted/updated correctly as they are not correctly formated for MySql.

I had to add the following code to the update method. Same code would also be required for insert I think.

Do you have a better solution than mine ?

 

$result = date_parse($model->$property);
                             
if($result["error_count"] == 0)
{
    $input_parameters [] = date_format(new DateTime($model->$property), 'Y-m-d H:i:s');
}
else
{
    $input_parameters [] = $model->$property;
}
Emmanuel
Top achievements
Rank 1
 answered on 26 Apr 2017
3 answers
117 views
By utilizing the PHP wrapper, I have set a grid field as type boolean.

The field however does not bind to the datasource, as the field ends up with value false even when datasource field value is 1 (true).

In MySQL database, the field was first set to TINYINT(1) then to BOOLEAN with same resulting missing binding.

How to bind such a grid field to a boolean datasource field?

And how to let this boolean field come up as a checkbox, not as true & false? I think such boolean fields in general should always end up as checkboxes by default, not as true & false, yes & no etc...
Emmanuel
Top achievements
Rank 1
 answered on 20 Apr 2017
1 answer
74 views

Hello,

I'm trying to solve problem with rendering objects, I've found a solution using custom template for field.

My code:

$interprets = new \Kendo\UI\GridColumn();
       $interprets
           ->field('interprets')
           ->template('#
           var template = "<ul>";
   for (var i = 0; i < interprets.length; i++) {
       template = template + "<li>" + interprets[i].contact.name+ "</li>";
   }
 
   return template + "</ul>";
#')
           ->title('interprets');

But the result is not what I expected, it can be seen on screenshot attached.

Can you please tell me, how to solve this issue?

Thanks a lot

 

Viktor Tachev
Telerik team
 answered on 13 Apr 2017
1 answer
158 views

Hi!

I'm using Kendo UI for Php for create a grid, I connect it to mysql db and I get the data.

I get the id and some other data, when I update I have to edit also other field that I don't show to the user. I need to use custom query but I cannot get the data from $request->models 

Can someone help me?

Thanks

I'm trying
I'm trying
I'm trying
Boyan Dimitrov
Telerik team
 answered on 04 Apr 2017
1 answer
67 views
I am using REST API, is there a way ho to create new items with POST request?
Stefan
Telerik team
 answered on 29 Mar 2017
Top users last month
Mark
Top achievements
Rank 1
Yurii
Top achievements
Rank 1
Leland
Top achievements
Rank 2
Iron
Iron
Iron
Hon
Top achievements
Rank 1
Iron
Deltaohm
Top achievements
Rank 3
Bronze
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?