Telerik Forums
Kendo UI for jQuery Forum
3 answers
373 views
Hi there! i'm giving support to a client who has a app developed on cakephp, and for grid they used Kendo ui. I have a table on database with the columns 'periodo', 'nro_beneficio', 'nombre', 'cuil', 'monto_haber' and 'estado'. And the fields 'porcentaje' and 'monto_anterior' are calculated fields. On the grid all fields shows ok, but the filter of the columns "porcentaje" and "monto_anterior" doesn't work. Can you tell me what i'm doing wrong??

$(document).ready(function() {


   var dataSource = new kendo.data.DataSource({
        type: 'json',
        transport: {
            read: {
                url: BASE_URL + '<?php echo $this->Html->url( array("controller" => "reportes", "action" => "haberes.json") ); ?>',
                dataType: 'json'
            },
        },
        filter: {field:'Haberespilotoscabecera.periodo', operator:'eq', value:'<?php if(isset($date)) echo $date; ?>'},
        schema: {
            model: {
                id: 'haber_piloto_detalle_id',

                fields: {
                    periodo: {
                        from: 'Haberespilotoscabecera.periodo',
                        type: 'date'
                    },
                    nro_beneficio: {
                        from: 'Haberespiloto.nro_beneficio',
                        editable: false
                    },                      
                    nombre: {
                        from: 'Piloto.nombre',
                        editable: false
                    },
                    cuil: {
                        from: 'Piloto.cuil',
                        editable: false                 
                    },
                    monto_haber: {
                        from: 'Haberespiloto.monto_haber',
                        editable: false                 
                    },
                    estado: {
                        from: 'Haberespiloto.estado_importacion_haber_id',
                        editable: false         
                    },
                }
            },
            data: 'results',
            total: 'total'
        },
        batch: true,
        serverPaging: true,
        serverSorting: true,
        serverFiltering: true,
        pageSize: 30
    });



    var wnd,detailsTemplate;

    var columns = [
    {
        field: 'Haberespiloto.nro_beneficio',
        title: '<?php echo __("Nro Beneficio"); ?>'
    },{
        field: 'Haberespiloto.numero_legajo',
        title: '<?php echo __("Legajo"); ?>',
        filterable: true
    },{
        field: 'Piloto.name',
        title: '<?php echo __("Nombre"); ?>'

    },{
        field: 'Estadosimportacionhaberespiloto.nombre',
        title: '<?php echo __("Estado"); ?>',
        
    },{
        field: 'Haberespiloto.monto_haber',
        title: '<?php echo __("Monto"); ?>',
        template: '#= kendo.toString(kendo.parseFloat(Haberespiloto.monto_haber), "c") #',
        format: '{0:c}'

    },{
        field: 'monto_anterior',
        title: '<?php echo __("Monto Ant."); ?>',
        template: '#= kendo.toString(kendo.parseFloat(Haberespiloto.monto_anterior), "c") #',
        format: '{0:c}'

    },{
        field: 'porcentaje',
        title: '<?php echo __("Porcentaje"); ?>',
        template: '#= kendo.toString(kendo.parseFloat(Haberespiloto.porcentaje), "p") #',
        format: '{0:p}',
        filterable:

    }];

 
});

Preslav
Telerik team
 answered on 24 Sep 2018
1 answer
76 views

Helllo,

 

I'm trying to filter a set of tasks with summary tasks. My first try was to use the filter on the datasource, but then the summaries are getting filtered out.

What approach should I use?

Data set:

- Section 100  (=summary) 
   - Task A 
   - Task B

When I filter on "A" I hope to see:

- Section 100 
    - Task A 

But since "Section 100" has no "A" I see nothing at all.

 

Kind regards,

Gert-Jan

 

Plamen
Telerik team
 answered on 24 Sep 2018
1 answer
3.3K+ views

I have this code on my jhtml page:

$("#myselect").kendoComboBox({
                        dataTextField: "Name",
                        dataValueField: "Id",
                        filter: "contains",
                        autoBind: false,
                        minLength: 3,
                        dataSource: {
                            serverFiltering: true,
                            type: "json",
                            transport: {
                                read: {
                                    url: "/controller/retrivedata",
                                    contentType: "application/json;",
                                    dataType: "json",
                                    data: function () {
                                        return {
                                            CustomId: data.MyCustomIdValue
                                        }
                                    }
                                }
                            }
                        },
                        select: function (e) {
                            if (e.dataItem) {
                                var dataItem = e.dataItem;
                                alert(selectedItem.Id);
                                alert(selectedItem.Name);
                                data.OtherComboId = parseInt(selectedItem.Id);
                                $('#otherCombo').data('kendoComboBox').dataSource.read();
                            }
                        }
                    });

 

The combo box load data correctly but on the select event I can not get the select object. I need the data value.

e.dataItem is undefined.

e.item contain the LI element but I never have found the value (onli the text)

How I can read the datavalue?

LSo

Plamen
Telerik team
 answered on 24 Sep 2018
8 answers
827 views
Hi,

I am using the cascading combo box in a very similar way to the MVC demo on the demos page. I currently have 6 combo boxes cascaded together in the same page. Occasionally I am getting the exception below, I assume this is because the page isn't fully loaded and the user has tried to interact with the page, therefore causing the combo to attempt to submit an AJAX request to get it's data.

    Microsoft JScript runtime error: Cannot call method 'value' of kendoDropDownList before it is initialized

Is there a correct way of checking whether Kendo controls are fully initialised ? If not how can I catch this exception ?
Judd
Top achievements
Rank 2
 answered on 21 Sep 2018
1 answer
282 views

How can I change category axis label names. 

http://dojo.telerik.com/uxoJA

 

For example in this example I want to keep months same just change the display name. IE: instead of "January" - "Month One" , just for january. and "Month 4" for April

Tsvetomir
Telerik team
 answered on 21 Sep 2018
2 answers
5.8K+ views
Looking for how to specify the maximum length of a column  that user can edit or input !
Like a column is of type 'number', so limiting the user to enter only 10 num/char
For column with type 'string' , limiting to enter say 200 chars

Is it possible with specifying just an attribute ?
Markus
Top achievements
Rank 1
 answered on 21 Sep 2018
1 answer
149 views

Hi,

I am see an issue with the way the Editor component works inside a modal dialog. It seems that the resizing of the editor is wrong when in a dialog.  I have attached a sample solution so you can see it for your self.

 

In the sample, you can see three different editors using pretty much the same MVC helper. One on the home page, one is in a Window component and one in a Dialog.   All three have resizeable set to true.

The home page editor and the window editor resize consistently.  The dialog editor resizes the component but not the text area of the component.

I need to use it in the dialog.  

Thanks,

Ed

Ianko
Telerik team
 answered on 21 Sep 2018
2 answers
327 views

Hello,

to resample a large dataset on server side I need to know the width of the categoryaxis of a line chart.
As workaround I use now the width of the div: $("#chart").width().

How can I get the width of $("#chart").data("kendoChart").options.categoryAxis ?

Best regards,

Peter

Peter
Top achievements
Rank 1
 answered on 21 Sep 2018
1 answer
61 views

Hi,

I have a scnario wher ei have used multiple custom telpmates to dsiplay dropdownlist on kendo grid Inline Edit. When i try to update ,its working fine in chrome but its not working with IE.

 

Could you please provide some suggestions.

 

 

 

Thank you,

Mani Teja

Georgi
Telerik team
 answered on 21 Sep 2018
2 answers
274 views

I am trying to add a menu to the Editor tools that populates based on a AJAX get call. The menu will add html to the editor.

<code>

$('#OptionTextReport').kendoEditor({
tools: [
"bold",
"italic",
"underline",
"strikethrough",
{
name: "insertFeature",
template: '<ul id="featureTool"></ul>'
}
],
resizable: {
content: true,
toolbar: true
}
});
var editor = $('#OptionTextReport').data("kendoEditor");

var updateFeatureList = function (featureList) {
var list = [];
$.each(featureList, function(index, value) {
list.push({
text: value.FeatureDescription,
attr:{ featureid: value.FeatureId, description: value.FeatureDescription },
select: function (e) {
var id = $(e.target).parent().attr("featureid");
var description = $(e.target).parent().attr("description");
var html = '<span class="feature" featureid="' + id + '">[' + description + ']</span>';
editor.exec("insertHtml", { value: html });
$('.k-animation-container').hide();
featureMenu.close();
}
});
});
var result = {
text: 'Insert Feature',
cssClass: "insert-feature",
items: list
}
featureMenu.remove(".insert-feature");
featureMenu.append([result]);
}

$.get(window.pulse.Category.Url.GetOptionFeatures + '?optionId=' + optionId, function (data) {
updateFeatureList(data.Data);
}, 'json');

</code>

The menu populates correctly but when selecting an item from the list the menu stops working. the style changes and clicking on the menu does nothing.

I am using Kendo version 2018.2.620 and JQuery version 3.31 and testing using chrome 69.0.3497.81.

Ivan Danchev
Telerik team
 answered on 21 Sep 2018
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?