Telerik Forums
Kendo UI for jQuery Forum
2 answers
677 views

I have a TimeSpan field called duration that is being returned from MS-Sql Server.  I am trying to format that field for display in a grid as mm:ss

I've parsing it as a date for a template but that hasn't worked as I don't believe it is a date.

 

{
                    field: "duration",
                    title: "Duration",
                    template: "#= kendo.toString(kendo.parseDate(duration), 'mm:ss') #",
                    width: 120,
                    filterable: false
                },

Any suggestions greatly appreciated.

Roger
Top achievements
Rank 2
Veteran
 answered on 24 Mar 2021
5 answers
474 views

Can I change the filter to be a treeview if I have a hierarchical data source for it?  I've been trying but not seeing any data.If I view the source I can see the treeview and all the data but the filter doesn't show the data on the screen.

 

My column is defined like this:

field: "country",
                    headerTemplate: '<span title="' + myTranslator.translate("Country", "Country") + '" data-toggle="tooltip" data-placement="right">' + myTranslator.translate("Country", "Country") + '</span>',
                    filterable: {
                        ui: createCountrySelect,
                        extra: false,
                        operators: {
                            string: {
                                contains: myTranslator.translate("Contains", "Contains")
                            }
                        }
                    },
                    groupHeaderTemplate: kendo.template($("#group-row-template").html())

 

And the createCountrySelect:

 

function createCountrySelect(element) {
    element.removeAttr("data-bind");
 
    var ds = new kendo.data.HierarchicalDataSource({
        data: vm.unflattedGeographicUnits,
        schema: {
            model: {
                id: "recordID",
                hasChildren: function (node) {
                    return (node.items && node.items.length > 0);
                },
                children: {
                    schema: {
                        data: "items",
                        model: {
                            id: "recordID",
                            hasChildren: function (node) {
                                return (node.items && node.items.length > 0);
                            }
                        }
                    }
                }
            }
        }
    });
 
    element.kendoTreeView({
        dataSource: ds,
        dataTextField: "name",
        change: function (e) {
            var filter = { logic: "or", filters: [] };
            var values = this.value();
            $.each(values, function (i, v) {
                filter.filters.push({ field: "geographicUnits", operator: "contains", value: v });
            });
            vm.countryDataSource.filter(filter);
        }
    });
}

 

Josiah
Top achievements
Rank 1
Veteran
 answered on 24 Mar 2021
3 answers
1.7K+ views

I'm trying to filter my grid using multiple multiselect controls in a toolbar template. They each seem to work separately, sort of, but not completely together as I would like. I know it's just a matter of getting the filtering logic written correctly, but I've been at it for days now and can't seem to get it working 100%. The grid is running in Row filtering mode.

I want to filter multiple columns based on multiple selections.

For simplicity sake, I'll break it down like this:

I have a Species column that might contain: Kokanee, Rainbow Trout, Salmon, Steelhead, Walleye

I have an Area Type column that might contain: Freshwater Lake, River, Marine, Secret

I can get it to filter by a single species, or by a single area type, as the records in the grid can only be of one type, and have one species.

What I want to filter by looks like this: (Kokanee OR Salmon) AND (Freshwater Lake OR River)

I would want to be able to show both of those species, in either of those area types.

My Multiselects look like this:
                    @(Html.Kendo().MultiSelect()
                        .Name("areaTypeFilter")
                        .Placeholder("All Area Types")
                        .DataTextField("AreaTypeName")
                        .DataValueField("AreaTypeID")
                        .AutoBind(true)
                        .AutoClose(false)
                        .AutoWidth(true)
                        .Events(e => e.Change("filterChange"))
                        .DataSource(ds =>
                        {
                            ds.Read("ToolbarTemplate_AreaType", "Reports");

                        })
                    )

My filtering function:

        function filterChange() {
            var filters = [];
            var grid = $("#Grid").data("kendoGrid");

            if ($("#areaTypeFilter").val()) {
                $.each($("#areaTypeFilter").val(), function (key, id) {
                    filters.push({ field: "AreaTypeID", operator: "eq", value: id });
                });
            }
            if ($("#stateFilter").val()) {
                //filter = [];
                $.each($("#stateFilter").val(), function (key, id) {
                    filters.push({ field: "StateID", operator: "eq", value: id });
                });
            }
            if ($("#countyFilter").val()) {
                $.each($("#countyFilter").val(), function (key, id) {
                    filters.push({ field: "CountyID", operator: "eq", value: id });
                });
            }
            if ($("#speciesFilter").val()) {
                //filter = [];
                $.each($("#speciesFilter").val(), function (key, id) {
                    filters.push({ field: "SpeciesID", operator: "eq", value: id });
                });
            }
            grid.dataSource.filter({ logic: "and", filters: filters });
        }

 

I've tried changing the logic to OR from AND and that's definitely not the issue. Any help would be appreciated.

Patrick | Technical Support Engineer, Senior
Telerik team
 answered on 24 Mar 2021
4 answers
2.0K+ views

````

$("#grid").kendoGrid({
                dataSource: {
                    type: "odata",
                    transport: {
                        read: "https://demos.telerik.com/kendo-ui/service/Northwind.svc/Customers"
                    },
                    pageSize: 15
                },
                height:600,
                groupable: true,
                sortable: true,
                pageable: {
                    refresh: true,
                    pageSize: 15,
                    pageSizes: [15,30,50,'all'],
                    buttonCount: 5
                },
                columns: [{
                    template: "<div class='customer-photo'" +
                    "style='background-image: url(https://demos.telerik.com/kendo-ui/content/web/Customers/#:data.CustomerID#.jpg);'></div>" +
                    "<div class='customer-name'>#: ContactName #</div>",
                    field: "ContactName",
                    title: "联系人",
                    width: 210
                }, {
                    field: "ContactTitle",
                    title: "职位"
                }, {
                    field: "CompanyName",
                    title: "公司"
                }, {
                    field: "Country",
                    title: "国家",
                    width: 150
                }]
            });

```````

Mihaela
Telerik team
 answered on 24 Mar 2021
1 answer
178 views

Hi,

Could i know if there is an slave content for disabling "arrow" ?

 

Regards

Mihaela
Telerik team
 answered on 24 Mar 2021
2 answers
596 views

Hi

 

I have an master detail grid in Jquery but how could i force "detail" grid in initialisation step ?

 

 

Regards

Anton Mironov
Telerik team
 answered on 24 Mar 2021
4 answers
11.9K+ views
Hi All


   This is my first Post on telerik, I usually browse to fix any code issues i got, but currently I am facing little bit tough time to fix it, its just adding a button column on the KendoGrid, where I am able to get Checkbox(both row and headertemplate) but I am not able to add simple button in kendogrid, so that on click of that button on each row it should redirect to "ActionResult" controller for further steps, I tried different ways to add button but couldn't succeeded, Please check the code and let me know am I missing anything wrong



CODE(part of the code)


, columns: [
                { field: "ID", Title: "ID", filterable: false, sortable: false, hidden: true },
                { field: "RowID", Title: "RowID", filterable: false, sortable: false, hidden: true },
                { field: "Bill", Title: "Bill", filterable: false, sortable: false,hidden:true },
                { field: "ServiceName", Title: "ServiceName",width:600 },
                { field: "ServiceStatus", Title: "ServiceStatus",width:150 }
// Creating template column
               , {
                   field: "Action", title: "Is Action", template: "<input type=\"checkbox\"    #= Action ? checked='checked' : '' #  class=\"check_row\"/> ", editable: false,                   
    headerTemplate: '<label>  <input type="checkbox" id="checkAll"/>Print All</label>', filterable: false, sortable: false, width: 100,                     
               }
               ,{
                  // PLANNED TO GET A BUTTON HERE SO THAT I CAN HAVE BUTTON ON EACH ROW AT LAST COLUMN
                }
             ]

 let me know code to create button related to above code and i want it to the end of all columns

Regards
Manju
Anton Mironov
Telerik team
 answered on 24 Mar 2021
5 answers
113 views

In order to make an example of a real-time changing bullet chart, I hope that it's possible to bind the series data to the value of slider.

 

Currently I understand chart can use source binding, but I wonder if it's possible to bind one of series data of bullet chart to the value of slider (for example, the current value is bound, and target, category, color are fixed).

Take this for example:

<input data-role="slider" data-bind="value: selectNumber">

<div data-role="chart" data-series="[{ type: 'bullet', currentField: 'current', targetField: 'target', colorField: 'color', target: { color: 'black' } }]" data-bind="source: dsChart"></div>

 

I hope that I can only bind the current value instead of a whole data source (dsChart) to the value of slider (selectNumber).

Furthermore, I also don't know how to bind the data source (dsChart) to the value of slider (selectNumber).

 

Can anyone give me a hint or an example?

 

Thanks.

Kent
Top achievements
Rank 1
Iron
 answered on 24 Mar 2021
1 answer
191 views

Hi,

I tried the following code to refresh the list items of a ComboBox widget, but it didn't work.  It didn't trigger a data retrieval call.  Not sure what's wrong.

    widget.dataSource.read();
    widget.refresh();

 

The data source is created as follows:

new kendo.data.DataSource({
    serverFiltering: true
    transport: {
        read: {
            url: "xxxx",
            dataType: "json",
            data: function (e) {
                // some code to dynamically prepare the call parameters
            },
            type: "POST"
        }
    },
    schema: {
        data: function (response) {
            if (response != null) {
                var result = JSON.parse(response);
                return (result.Data != null ? result.Data : "");
            } else {
                return "";
            }
        }
    }
});

 

Please advise.  Thanks.

Martin
Telerik team
 answered on 23 Mar 2021
8 answers
1.9K+ views

What I would like to do is call the Save As Excel from an external button, show a progress spinner instead of the button, and when the export is finished show the button again.  This is to let the user know longer running exports are processing and not to keep clicking the button.

Here is some example code that fires the hide immediately after the save is called.

$('#export').click(function (e) {     
    showProgress();     
    e.preventDefault();     
    $('#Results').getKendoGrid().saveAsExcel();     

    // Bug: This processes immediately, need to wait for saveAsExcel to finish.     
    hideProgress();
});

Tsvetomir
Telerik team
 answered on 23 Mar 2021
Narrow your results
Selected tags
Tags
Grid
General Discussions
Charts
Data Source
Scheduler
DropDownList
TreeView
MVVM
Editor
Window
DatePicker
Spreadsheet
Upload
ListView (Mobile)
ComboBox
TabStrip
MultiSelect
AutoComplete
ListView
Menu
Templates
Gantt
Validation
TreeList
Diagram
NumericTextBox
Splitter
PanelBar
Application
Map
Drag and Drop
ToolTip
Calendar
PivotGrid
ScrollView (Mobile)
Toolbar
TabStrip (Mobile)
Slider
Button (Mobile)
Filter
SPA
Drawing API
Drawer (Mobile)
Globalization
LinearGauge
Sortable
ModalView
Hierarchical Data Source
Button
FileManager
MaskedTextBox
View
Form
NavBar
Notification
Switch (Mobile)
SplitView
ListBox
DropDownTree
PDFViewer
Sparkline
ActionSheet
TileLayout
PopOver (Mobile)
TreeMap
ButtonGroup
ColorPicker
Pager
Styling
MultiColumnComboBox
Chat
DateRangePicker
Dialog
Checkbox
Timeline
Drawer
DateInput
ProgressBar
MediaPlayer
ImageEditor
TextBox
OrgChart
Effects
Accessibility
PivotGridV2
ScrollView
BulletChart
Licensing
QRCode
ResponsivePanel
Switch
Wizard
CheckBoxGroup
TextArea
Barcode
Breadcrumb
Collapsible
Localization
MultiViewCalendar
Touch
RadioButton
Stepper
Card
ExpansionPanel
Rating
RadioGroup
Badge
Captcha
Heatmap
AppBar
Loader
Security
TaskBoard
Popover
DockManager
FloatingActionButton
CircularGauge
ColorGradient
ColorPalette
DropDownButton
TimeDurationPicker
ToggleButton
TimePicker
BottomNavigation
Ripple
SkeletonContainer
Avatar
Circular ProgressBar
FlatColorPicker
SplitButton
Signature
Chip
ChipList
VS Code Extension
AIPrompt
PropertyGrid
Sankey
Chart Wizard
OTP Input
SpeechToTextButton
InlineAIPrompt
StockChart
ContextMenu
DateTimePicker
RadialGauge
ArcGauge
AICodingAssistant
+? more
Top users last month
Rob
Top achievements
Rank 3
Bronze
Iron
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Bronze
Iron
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?