Telerik Forums
Kendo UI for jQuery Forum
5 answers
302 views

Hello,

I would like to be able to filter my chart according to dates. The problem is that the filter does not apply correctly. If I put the beach from May 1st to the end of May, I have dates of April and even February 2018 coming up. 

Here is an example Dojo (Normally I receive the datasource dynamically)

Thank you for your help. 

n/a
Top achievements
Rank 1
 answered on 23 May 2019
3 answers
343 views

I am looking for an example similar to this demo:

https://demos.telerik.com/kendo-ui/pdf-export/page-layout

 

However when there are more table rows I need a separate page.

I can get the pdf output working correctly (including page headers and footers), but the on-screen content does not match.

a) no second page on the screen (either to scroll or via pagination controls)

b) the page header/footer from the template I used in the drawDOM options are not on the screen

 

Any ideas how to do this?

 

thank you!

Veselin Tsvetanov
Telerik team
 answered on 23 May 2019
1 answer
2.3K+ views

I have a grid with filterable mode: "menu,row". If I filter the dates by equal; not equal; >; <= it doesn't work. All my date are set to dd.mm.yyyy but when I look to my console.log filter value is not set correctly (see code bellow). How can Have the correct format, without time?

filter: function(e) {
    if (e.filter == null) {
        console.log("filter has been cleared");
    } else {
        console.log(e.filter.logic);
        console.log(e.filter.filters[0].field);
        console.log(e.filter.filters[0].operator);
        console.log(e.filter.filters[0].value);
    }
},

 

Answer: 

and
dateReleve
eq
Wed May 08 2019 00:00:00 GMT+0200 (heure d’été d’Europe centrale)

 

 

My code to create column

function createColumn(columnNames,lang){
    return columnNames.map(function(value){
        var hasTemplate = value.template !== null;
        var isHidden = value.hidden == 1;
        var typeDate = value.type == "date";
        var isLink = value.type == "link";
        var hasAttributeClass = value.class_css !== null;
        return {
            field: value.field,
            title: value.title,
            format: typeDate ? "{0:dd.MM.yyyy}" : "",
            filterable: typeDate ? {
                cell: {
                    operator: 'contains',
                    showOperators: false,
                    template: function(args) {
                        args.element.kendoDatePicker({
                            culture: lang,
                            format: "dd.MM.yyyy",
                            parseFormat: "dd.MM.yyyy"
                        });
                    }
                },
                ui:function(element){
                    element.kendoDatePicker({
                        culture: lang,
                        format:'dd.MM.yyyy',
                        parseFormat: "dd.MM.yyyy"
                    })
                }
            } : {
                cell: { operator: 'contains', showOperators: false}
            }
    });
}

 

M< code to create model

 

function createModel(columnNames){
    var model = {};
    var fields = {};
    $.each(columnNames, function(index,value){
        var propType = value.type;
        if (propType === "number" ) {
            fields[value.field] = {
                type: "number"
            };
        } else if (propType === "boolean") {
            fields[value.field] = {
                type: "boolean"
            };
        } else if (propType === "date") {
            //fields[value.field] = kendo.parseDate(value.field, "dd.MM.yyyy");
            fields[value.field] = {
                type: "date",
                format: "{0:dd.MM.yyyy}"
            };
        } else {
            fields[value.field] = {
                type: "string"
            };
        }
    });
    model.fields = fields;
    return model;
}


This code, give me that : 

filter: function(e) {
    if (e.filter == null) {
        console.log("filter has been cleared");
    } else {
        console.log(e.filter.logic);
        console.log(e.filter.filters[0].field);
        console.log(e.filter.filters[0].operator);
        console.log(e.filter.filters[0].value);
    }
},
and
dateReleve
eq
Wed May 08 2019 00:00:00 GMT+0200 (heure d’été d’Europe centrale)

 

How can Have the correct format, without time?

Thank you for your help

Georgi
Telerik team
 answered on 22 May 2019
1 answer
167 views

I've been trying to use the PHP wrapper for UI and get the grid to display my JSON data. If I set $dataSource->data($json) where $json is the result from my call it works, but when I set it to $dataSource->transport($transport) where $transport contains my read transport I get no rows to display in the grid.

 

I'm using the CodeIgniter framework and have the require statements as part of my autoload, so they are there along with the requirements in the header.

 

Here is my code:

<?php

//$json = json_decode(file_get_contents(site_url('data/sys_settings/read')),true);
$transport = new \Kendo\Data\DataSourceTransport();

$create = new \Kendo\Data\DataSourceTransportCreate();
$create->url(site_url('data/sys_settings/create'))
     ->contentType('application/json')
     ->type('POST');

$read = new \Kendo\Data\DataSourceTransportRead();
$read->url(site_url('data/sys_settings/read'));

$update = new \Kendo\Data\DataSourceTransportUpdate();
$update->url(site_url('data/sys_settings/update'))
     ->contentType('application/json')
     ->type('POST');

$destroy = new \Kendo\Data\DataSourceTransportDestroy();
$destroy->url(site_url('data/sys_settings/destroy'))
     ->contentType('application/json')
     ->type('POST');

$transport->read($read)
       ->parameterMap(new \Kendo\JavaScriptFunction('function(data) {
              return kendo.stringify(data)
          }'));


$idField = new \Kendo\Data\DataSourceSchemaModelField('id');
$idField->type('number')
->editable(false)
->nullable(false);

$repId = new \Kendo\Data\DataSourceSchemaModelField('rep_id');
$repId->type('number')
->editable(false)
->nullable(false);

$col1Field = new \Kendo\Data\DataSourceSchemaModelField('key');
$col1Field->type('string')
->editable(false)
->nullable(false);

$col2Field = new \Kendo\Data\DataSourceSchemaModelField('val');
$col2Field->type('string')
->editable(true)
->nullable(true);

$model = new \Kendo\Data\DataSourceSchemaModel();
$model->addField($idField)
->addField($repId)
    ->addField($col1Field)
    ->addField($col2Field);

$schema = new \Kendo\Data\DataSourceSchema();
$schema->data('data')
       ->errors('errors')
       ->model($model)
       ->total('total');



$dataSource = new \Kendo\Data\DataSource();
$dataSource->transport($transport)
           ->pageSize(20)
->serverFiltering(true)
->type('odata')
           ->schema($schema);



$col1 = new \Kendo\UI\GridColumn();
$col1->field('key')
          ->width(120)
          ->title('Settings');

$col2 = new \Kendo\UI\GridColumn();
$col2->field('val')
          ->width(120)
          ->title('Value');

$command = new \Kendo\UI\GridColumn();
$command->addCommandItem('edit')
        ->addCommandItem('destroy')
        ->title('&nbsp;')
        ->width(250);

$grid = new \Kendo\UI\Grid('grid');
$grid->addColumn($col1,$col2,$command)
->dataSource($dataSource)
->addToolbarItem(new \Kendo\UI\GridToolbarItem('create'))
->editable('inline')
->sortable(true);


echo $grid->render();

 

 

 

here is my JSON being sent from the URL:

{"data":[{"id":"1","rep_id":"0","key":"default_country","val":"USA"},{"id":"2","rep_id":"0","key":"default_state","val":"CA"},{"id":"4","rep_id":"0","key":"default_account_type","val":"Customer"},{"id":"5","rep_id":"0","key":"default_title","val":null}],"total":4,"errors":null}

 

 

 

I'm not sure what I'm doing wrong, but I can't get it to work via the transport.  Any help would be greatly appreciated.

Phillip
Top achievements
Rank 1
 answered on 22 May 2019
1 answer
431 views
In kendo multiselect dropdown,the problem we were facing is -if we add a very big new skill which cannot be selected from existing,the kendo goes on increasing its width and also on adding a small new skill, the cursor goes the next line.Let me know your solution to the above problem.To solve this issue, we added a class kendo-width to the bootstrap div class col-xs-12 col-sm-6 col-md-6 col-lg-6 (see the image) and we get the kendo width on page load and resize and apply that value to the class -k-multiselect-wrap k-floatwrap so that the top problem can be solved.code- $( window ).on("load resize",function() {

  var kendoWidthResize = $(".kendo-width").width() -6;
    $(".customize-kendo .k-multiselect-wrap.k-floatwrap").css("width", kendoWidthResize);  
});
On resize we are getting the correct width but on load the width is not applied to the .k-multiselect-wrap class and the kendo looks like a small textbox(see image).How to solve this issue?
Dimitar
Telerik team
 answered on 21 May 2019
2 answers
159 views
I have used hasChanges() to detect dirty flag in dataSource. But it behaves in strange way when we have 1 row inside Grid and if i we delete that still hasChanges() return false. 
              I have created DOJO demo https://dojo.telerik.com/alOHiyOV  
      What is official solution
Tsvetomir
Telerik team
 answered on 20 May 2019
2 answers
197 views
I'm trying to using Kendo Grid Inline Edit with MVC3 c#.net. I'm using Kendo.Mvc.dll 2012.2.423.340. It shows the list of the usages correctly. But not working for Edit and Update. When I click on Edit, it shows html code instead of the value only.

For example, for the Approved Usage ID, which is int. It shows as below in the edit box.

%3cinput class="text-box single-line" data-val="true" data-val-number="The field ApprovedUsageID must be a number." data-val-required="The ApprovedUsageID field is required." id="ApprovedUsageID" name="ApprovedUsageID" type="text" value="0" /%3e%3cspan class="field-validation-valid" data-valmsg-for="ApprovedUsageID" data-valmsg-replace="true"%3e%3c/span%3e

Can anybody tell me what's wrong with my code or any tips for debugging? I'm new on Kendo UI. Feeling lost on debugging because there is no error message and can hardly find answer through google.

Alright, I figured it out. Thanks,
Tsvetomir
Telerik team
 answered on 20 May 2019
14 answers
741 views
In the old MVC extensions, I tested if a grid had changes by using the following

grid.haschanges();


According to the transition guide here:
http://docs.kendoui.com/getting-started/using-kendo-with/aspnet-mvc/migration/widgets/grid


haschanges has been removed. 

So now with Kendo, how do I tell if the grid has changes?
Viktor Tachev
Telerik team
 answered on 20 May 2019
2 answers
457 views

Is there a work-around for the NIST Vulnerability identified in the Kendo Editor Widget?

 

 

Wendel
Top achievements
Rank 1
 answered on 17 May 2019
2 answers
49 views
Ok, so this might be a "duh" question, but is the hold function not compatible with iPad/iPhone?  It doesn't work, even in your demo.  I expect this is a "known" but nowhere in the limited documentation is it stated.
Ivan Danchev
Telerik team
 answered on 17 May 2019
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?