Telerik Forums
Kendo UI for jQuery Forum
3 answers
149 views

I have a filter on a datasource which in return updates a grid. The following are the code to filter and its' template handler.

 

The problem with this is that, I can load the categories at first when I'm creating the filters. But when I save and reload the filter from local storage, the category dropdown does not load. Please help me with this. It loads up only on a fresh filter.

Thanks in advance.


@(Html.Kendo().Filter<Lovely>()
                                .Name("OrgFilter")
                                .ApplyButton(true)
                                .ExpressionPreview(true)
                                .DataSource("DataSource")
                                .Fields(f =>
                                {
                                    f.Add(p=>p.OrgName).Label("Organization");
                                    f.Add(p=>p.CategoryId).Label("Category").EditorTemplateHandler("CategoryDropdown");
                                    f.Add(p=>p.AsAtDate).Label("As At Date");
                                }))

<script>
function CategoryDropdown(container, options) {
        $('<input data-bind="value: value" name="' + options.field + '"/>')
            .appendTo(container)
            .kendoDropDownList({
                dataTextField: "CategoryId",
                dataValueField: "CategoryId",
                dataSource: @Json.Serialize(ViewData["Catogories"])
            });
    }
</script>

Johhny
Top achievements
Rank 1
Iron
 answered on 30 Jun 2022
1 answer
656 views
we can set diff font sizes for page, header, footer, but is it possible to set  for exported grid body (table)?
Lance | Senior Manager Technical Support
Telerik team
 answered on 29 Jun 2022
7 answers
167 views

Problem I'm having is first column with commands does not sort. Is this not supported?

 

    $("#statusGrid").kendoGrid({
        dataSource: {
            transport: {
                read: async function (options) {
                    KendoData_Read(
                        options,
                        BaseAbs3ApiUrl + "api/CustomerDetail/GetCustomerStatusDetail",
                        { customerId: customerId }
                    );
                }
            },
            sort: [{ field: "CreatedDate", dir: "desc" }]
        },
        dataBound: function (e) {
            $(".k-grid-addDischarge").attr("title", "Add");
            $(".k-grid-editDischarge").attr("title", "Edit");
            $(".k-grid-viewDischarge").attr("title", "View");
        },
        toolbar: kendo.template($("#statusGridToolbarTemplate").html()),
        scrollable: false,
        excel: {
            allPages: true,
            fileName: "CustomerStatus.xlsx",
            proxyURL: "/save",
            filterable: true
        },
        excelExport: absKendoAutoWidthExcelExport,
        sortable: true,
        pageable: absKendoGridPageableDefault,
        noRecords: { template: "No records to display." },
        columns: [
            {
                command: [
                    {
                        name: "addDischarge",
                        text: "",
                        title: "Add",
                        visible: function (item) { return item.CanCreateDischargeDocument },
                        iconClass: "fas fa-plus fa-border",
                        click: function (e) {
                            e.preventDefault(); // prevent page scroll position change
                            var tr = $(e.target).closest("tr");
                            var data = this.dataItem(tr);
                            var url = "/Customer/Discharge/Create/" + data.CustomerStatusChangeId;
                            window.open(url, "_blank");
                        }
                    },
                    {
                        name: "editDischarge",
                        text: "",
                        title: "Edit",
                        visible: function (item) { return item.CanEditDischargeDocument },
                        iconClass: "fa fa-pencil-alt fa-border",
                        click: function (e) {
                            e.preventDefault(); // prevent page scroll position change
                            var tr = $(e.target).closest("tr");
                            var data = this.dataItem(tr);
                            var url = "/Customer/Discharge/EditByStatusChangeId/" + data.CustomerStatusChangeId;
                            window.open(url, "_blank");
                        }
                    },
                    {
                        name: "viewDischarge",
                        text: "",
                        title: "View",
                        visible: function (item) { return item.CanViewDischargeDocument },
                        iconClass: "fas fa-eye fa-border",
                        click: function (e) {
                            e.preventDefault(); // prevent page scroll position change
                            var tr = $(e.target).closest("tr");
                            var data = this.dataItem(tr);
                            var url = BaseAbs2Url + "SSRSReports/Report.aspx?report=DischargeandTransferSummary&cuCustomerStatusChangeId=" + data.CustomerStatusChangeId;
                            window.open(url, "_blank");
                        }
                    }
                ]
                , headerTemplate: "Document<br />Actions", title: "Document Actions", width: "10em", sortable: true, field: "DocumentActions"
            },
            { field: "Id", hidden: true },
            { title: "Status", field: "CurrentStatusTypeName", width: "20em", sortable: true },
            { headerTemplate: "Status Change<br />Reason", title: "Status Change Reason", field: "CustomerStatusChangeReasonName", width: "20em", sortable: true },
            { headerTemplate: "Admit/Start<br />of Care Date", title: "Admit/Start of Care Date", field: "AdmitStartCareDateText", width: "12em", sortable: true, template: function (item) { return formatKDate(item.AdmitStartCareDate); } },
            { title: "Service Hold/End of Care Date", field: "ServiceHoldEndCareDateText", width: "12em", sortable: true, template: function (item) { return formatKDate(item.ServiceHoldEndCareDate); } },
            { headerTemplate: "Resumption of<br />Care Date", title: "Resumption of Care Date", field: "ResumptionCareDateText", width: "12em", sortable: true, template: function (item) { return formatKDate(item.ResumptionCareDate); } },
            { headerTemplate: "Discharged<br />Closed Date", title: "Discharged Closed Date", field: "DischaredClosedDateText", width: "12em", sortable: true, template: function (item) { return formatKDate(item.DischaredClosedDate); } },
            { headerTemplate: "Status<br />Comments", title: "Status Comments", field: "StatusChangeComment", width: "20em", sortable: true },
            { headerTemplate: "Status<br />Change Date", title: "Status Change Date", field: "CreatedDateText", width: "12em", sortable: true, template: function (item) { return formatKDate(item.CreatedDate); } },
            { headerTemplate: "Status<br />Changed By", title: "Status Changed By", field: "CreatedByName", width: "15em", sortable: true },
            { title: "Discharge/Transfer Document Status", field: "DischargeDocumentStatus", width: "12em", sortable: true }
        ]
    });
Brightstar
Top achievements
Rank 1
Iron
Iron
Iron
 answered on 29 Jun 2022
0 answers
128 views

hello,

I want to access the spreadshet object in Angular, export and import data.

Example

(A completely imaginary example. I don't know how.)

 dataExport() {
    kendo.jQuery(this.spreadsheetEl.nativeElement).kendoSpreadsheet({
        function() {
            var sheet = $("#spreadsheet").data('kendoSpreadsheet').activeSheet();
            var range = sheet.selection();
            console.log(sheet.toJSON());
        }
    });
  }


how can I do it ?

thanks in advance

kypdk
Top achievements
Rank 1
Iron
 updated question on 29 Jun 2022
1 answer
197 views

Hello,

I am working with application where I have thousands of images to load on ImageBrowser of Kendo Editor.

ImageBrowser is getting stuck as having too many images to load, Can we have any option to add pagination or lazy loading in ImageBrowser?

So, I can load only 20 images at a time and other based on request.

Please note that I am fetching images from controller method which returns list of FileBrowserEntry as below.

 

 

Thanks,

Trusha

 

Martin
Telerik team
 answered on 29 Jun 2022
1 answer
114 views

Hi Team,

I would like to fire a validation post drag but pre-drop, this should allow me to cancel the drop and show a message to enduser explaining the cause.

the drop event only allows to modify the rendered alert dialog but it doesnt allow me to cancel the event altogether. 

any help is appriciated.

Regards,

Ashutosh

Neli
Telerik team
 answered on 29 Jun 2022
0 answers
175 views

Hi,

I'm not sure if the issue I have is related to kendo ui, but seeing an issue where code I run on my local computer on central time works fine, but when I deploy to the server (eastern time), some of my dates are shifting in the Scheduler control when I iterate through it.

I'm using the kendo.parseDate function on start/end dates

return kendo.parseDate(kendo.toString(input, 'd')).toLocaleDateString("en-US");

That works fine locally, but deployed to the server shifts an hour, which then saves the wrong date in my database.

Is there a timezone saved anywhere in the configs for developer machine that might be getting pushed to server?  Switching my computer timezone to eastern and then deploying seems to work fine.


Thanks

Kevin
Top achievements
Rank 2
Iron
Iron
Iron
 asked on 28 Jun 2022
1 answer
415 views

Hi,

 

I was researching available control in Kendo to achieve my requirements it seems that multi-select control is what I need. but I am unsure how i do the templating for the control. my markup for the dropdown is 


<select id="users">
<option value="1" data-email="abc@email.com">User 1</option>
<option value="2" data-email="12@email.com">User 2</option>
<option value="3" data-email="adc@email.com">User 3</option>
<option value="4" data-email="anmf@email.com">User 4</option>
</select>

 

what I wanted to achieve is when the user is selecting the option to show User 1 - abc@email.com. then upon selected, the tag to show User 1.

 

I understand that multi-column combo box is able to achieve this but i need to be able to select multiple options. I also prefer to render the control via HTML way instead of using json data source

Martin
Telerik team
 answered on 28 Jun 2022
1 answer
123 views

Hi,

I am trying to use Gantt widget with Drawer located at the right side. 

For some reason, when I position drawer to the right, even with mini mode it is always outside of the screen (horizontal scroll appears) - if i expand drawer, it basically expands it to the right, and remains outside screen, horizontal scroll just expands area.

When drawer is positioned on the left it works normally (pushes gantt for width of drawer).

Behavior can be observed in following Dojo:

https://dojo.telerik.com/EdIQaXeY

Thank you very much

Regards

Vedad

Georgi Denchev
Telerik team
 answered on 28 Jun 2022
1 answer
686 views

I'm using the Kendo combobox on a edit form.  I'm loading initial values into the comboboxes on page load by using the "value" and "text" properties.  I have autobind set to false.  If I click the "clear" button it doesn't actually clear out the text value until the second time I click it.  It looks like the first time I click clear it loads the actual data items and then selects the value I have it set to.  The second time I click clear it actually works.  What is the proper way to configure this to load values from the server and preload a specific item when the control initializes?

 


 @(Html.Kendo().ComboBox()
                            .Name("combo" + item.DataField.ID)
                            .Filter("contains")
                            .DataTextField("DataTextField")
                            .DataValueField("DataTextValue")
                            .Placeholder("Select an item...")
                            .AutoBind(false)
                            .ClearButton(true)
                            .DataSource(source =>
                            {
                                
                                source.Custom()
                                    .ServerFiltering(true)
                                    .ServerPaging(true)
                                    .PageSize(40)
                                    
                                    .Type("aspnetmvc-ajax") //Set this type if you want to use DataSourceRequest and ToDataSourceResult instances
                                    .Transport(transport =>
                                    {

                                        transport.Read(r =>
                                        {

                                            
                                            r.Action("Virtualization_ReadComboEdit3", "Search", new { dataFieldId = item.DataField.ID }).Type(HttpVerbs.Post).Data("getFormData");



                                        });
                                        

                                    })
                                    
                                    .Schema(schema =>
                                    {
                                        schema.Data("Data") //define the [data](https://docs.telerik.com/kendo-ui/api/javascript/data/datasource#configuration-schema.data) option
                                              .Total("Total"); //define the [total](https://docs.telerik.com/kendo-ui/api/javascript/data/datasource#configuration-schema.total) option
                                    });
                            })
                        .HtmlAttributes(new { style = "width:100%;", data_parent_id = (item.DataField.ParentDataFieldID!=null ? item.DataField.ParentDataFieldID.ToString() : ""), data_conditional = item.DataField.IsConditionListener })
                        .FooterTemplate("<b>#: instance.dataSource.total() # items found<b/>")
                        .Events(e =>
                        {
                            e.Select("onSelectCombo");
                            e.Open("onOpenCombo");
                            e.Change("onChangeCombo");



                        })
                        .Virtual(v =>
                        {
                            v.MapValueTo("dataItem");
                            v.ItemHeight(26);
                            v.ValueMapper(e => "function(options) { dropdownMapper(options," + item.DataField.ID + "); }");
                        })
                        .Value(item.DataField.CurrentFieldValueSingle.ToString())
                        .Text(item.DataField.CurrentFieldText)
                            )

Anton Mironov
Telerik team
 answered on 28 Jun 2022
Narrow your results
Selected tags
Tags
Grid
General Discussions
Charts
Data Source
Scheduler
DropDownList
TreeView
MVVM
Editor
Window
Date/Time Pickers
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)
SPA
Filter
Drawer (Mobile)
Drawing API
Globalization
Gauges
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
OrgChart
TextBox
Effects
Accessibility
ScrollView
PivotGridV2
BulletChart
Licensing
QRCode
ResponsivePanel
Switch
Wizard
CheckBoxGroup
TextArea
Barcode
Collapsible
Localization
MultiViewCalendar
Touch
Breadcrumb
RadioButton
Stepper
Card
ExpansionPanel
Rating
RadioGroup
Badge
Captcha
Heatmap
AppBar
Loader
Security
Popover
DockManager
FloatingActionButton
TaskBoard
CircularGauge
ColorGradient
ColorPalette
DropDownButton
TimeDurationPicker
ToggleButton
BottomNavigation
Ripple
SkeletonContainer
Avatar
Circular ProgressBar
FlatColorPicker
SplitButton
Signature
Chip
ChipList
VS Code Extension
AIPrompt
PropertyGrid
Sankey
Chart Wizard
OTP Input
SpeechToTextButton
InlineAIPrompt
+? more
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
Radek
Top achievements
Rank 2
Iron
Iron
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Richard
Top achievements
Rank 4
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
Radek
Top achievements
Rank 2
Iron
Iron
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Richard
Top achievements
Rank 4
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?