Telerik Forums
Kendo UI for jQuery Forum
0 answers
115 views

I've tried to get this working using this aspnetmvc-ajax sample code from telerik found here.

https://demos.telerik.com/kendo-ui/grid/grouppaging

I'm using jquery ajax restful api for the remote data endpoint and I am returning the response in the exact format as shown in the above example but it doesn't work.

After the grid loads, an "undefined" is displayed as the first row in the grid despite the data from the ajax data call returning the data in the exact same format as shown in the above example.

I also added the code for the sample into my project and I tried a local data source in order to rule out jquery ajax as remote api being the problem with the same response data format as the sample code to see if the server side group paging is anyway dependent on the datasource.type being aspnetmvc.  In this case I also get the same error as seen in my jquery ajax grid with remote group paging.

Has anyone been able to get group paging for a grid using a custom function for the transport read (jquery ajax) configuration?

 

Can anyone confirm whether it should work for this use case? And does anyone have an example?

Thanks in advance and appreciate your help.

Best,

Don

 

Don
Top achievements
Rank 1
 updated question on 04 Jan 2022
1 answer
572 views
Is it possible for me to customize the hint Element during a row reorder operation using the kendo Grid rowReorder functionality?
Georgi Denchev
Telerik team
 answered on 04 Jan 2022
1 answer
899 views
Hi everybody,

I post today because i have this code and my edit function return me "e.model.isNew() is not a function"... i don't know why ? :

$("#table-luminaire").kendoGrid({
          dataSource: {
            data: ares
          },
          editable: {
            confirmation: "blabla ?",
            mode: "incell"
          },
          toolbar:["excel", "create", "save"],
          sortable: true,
          columnMenu : true,
          resizable : true,
          pageable: {
              refresh: true,
              pageSizes: true,
              buttonCount: 5,
              pageSize: 20,
          },
          columns: [{
              field: "ID",
              title: "ID",
              hidden:true,
          }, {
              field: "CATEGORIE",
              title: "Catégorie",
              width: 135,
              editable: function() {return array_decode.includes("CATEGORIE");}
          }, {
              field: "CODE_INSEE",
              title: "Code INSEE",
              width: 140,
              editable: function() {return array_decode.includes("CODE_INSEE");}
          },
          { command: ["edit", "destroy"], title: " ", width: "250px"}
          ],
          edit: function (e) {
              console.log(e)
            if (e.model.isNew()) {
                console.log('model')
            }
          },
          save: function(e) {
            console.log(e.values);
          },
          saveChanges: function(e) {
            console.log('ok save')
          },
          schema: {
            model: {
              id: "id"
            }
          },
        });

If someone have an idea ... Thank you in advance for your answers,

Erka

Nikolay
Telerik team
 answered on 03 Jan 2022
4 answers
7.3K+ views

This seems to be a pretty good example, but unfortunately it doesn't work:

http://docs.telerik.com/kendo-ui/controls/data-management/grid/how-to/Layout/apply-minimum-width-during-column-resize

Is this deprecated? The binding to the resizable-events doesn't seem to work.

 

Omid
Top achievements
Rank 1
Iron
 answered on 31 Dec 2021
1 answer
128 views

Hello,

I have a problem using the drawing library for creating PDFs with blocks being styled with a column-count style sheet being set to something other than 1 - it seems as if the drawing library is erroneously taking into account the sum of of all columns height instead of the real height when placing the output in a PDF, and thus leaving lots of blank space on the pages.

A working example can be found at Kendo UI Snippet | Kendo UI Dojo (telerik.com) (based on the page templates example)

Is this a known problem, am I missing something or is there any way/workaround to fix this?

Thanks & kind regards,

Hermann

 

Veselin Tsvetanov
Telerik team
 answered on 31 Dec 2021
1 answer
717 views

I've got a scenario where a tooltip is not hiding when another tooltip is shown, and here is a dojo for reference.

If you move your mouse up and down the colors, the tooltips show and hide as they should. If you stop on a color, move the mouse right into the tooltip, then straight back out of the tooltip and back into the color for that tooltip, then move the mouse up or down over another color, the first tooltip doesn't hide. You can repeat this sequence for the other tooltips as well, resulting in multiple tooltips showing.

Here is a jam so you can see what I mean as well. You can't see the mouse move, but you can see the multiple tooltips.

Ianko
Telerik team
 answered on 31 Dec 2021
2 answers
191 views

Hello,
I used the following approach for binding Kendo Gantt data source to local java-script array.

var dataSourceArray = [{...}, {...}, ...];
var fieldsObject = {id: { from: "id", type: "string", defaultValue: function () { return kendo.guid(); } }, parentId: { from: "parentId", type: "string", defaultValue: null }, start: { from: "start", type: "date" }, end: { from: "end", type: "date" }, title: { from: "title", type: "string" }, percentComplete: { from: "percentComplete", type: "number" }};
//we have pre-filled java-script array and fieldsObject
//define Kendo Gantt data source

var _dataSource = new kendo.data.GanttDataSource({

            schema: {
                model: {
                    id: "id",
                    fields: fieldsObject
                }
            },
            transport: {
                read: function (e) {
                    e.success(dataSourceArray );
                },
                create: function (e) {
                    if (e.data.models && e.data.models.length > 0) {
//...

                        }
                    }
                    else {
                        //...
                    }
                },
                update: function (e) {
                    if (e.data.models && e.data.models.length > 0) {
//...

                        }
                    }
                    else {
                        //...
                    }
                },
                destroy: function (e) {
                    if (e.data.models && e.data.models.length > 0) {
//...                       
                    }

                    }
                    else {
                       //...
                }
            },
            change: function (e) {
                if (e.action == "add" || e.action == "remove") {
                   //...
                }
                if ((e.action == "itemchange" || e.action == "remove") && (e.field == "percentComplete" || e.field == "start" || e.field == "end")) {
                   
                    }
                }
            }
        });

//Then Kendo Gantt is created

_kendoGantt = $("#gantt").kendoGantt({
                toolbar: [
{ template: kendo.template($("#headerTemplate").html()) }
                ],
                pdf: { fileName: $scope.selectedGantt },
                dataSource: _dataSource,
                dependencies: _dependencies, //also defined above in the code
                columns: _leftCols, //also defined above in the code
                views: [{ type: "day", selected: _ganttSettings.Timescale == "day" ? true : false }, { type: "week", selected: _ganttSettings.Timescale == "week" ? true : false },
{ type: "month", selected: _ganttSettings.Timescale == "month" ? true : false }, { type: "year", selected: _ganttSettings.Timescale == "year" ? true : false }],
                listWidth: _listWidth,
                showWorkDays: !_showWeekends,
                dataBound: _onTaskDataBound,
                moveStart: _onTaskMoveStart,
                resizeStart: _onTaskMoveStart,
                save: _onTaskSave,
                remove: _onTaskRemove,
                navigate: _onTaskNavigate,
                add: _onTaskDependencyAdd,
                change: _onTaskChange,
                edit: _onTaskEdit,
                height: _gHeight
            });

function _onTaskEdit(e) {
if(e.task.id){
//....
}
};

This code worked perfectly in version of Kendo UI v2016.3.1118, but it does not work in version v2021.2.616.

Using this code in version v2021.2.616 does not display any tasks in Kendo Gantt.

If I bind data source to local java-script array directly in Kendo Gantt constructor (dataSource: dataSourceArray), it displays tasks, but task does not have valid "id" (it is null) in event _onTaskEdit (when I double click task for editing). In this case id field must have string value according to: id: { from: "id", type: "string", defaultValue: function () { return kendo.guid(); } }

Your examples in documentation do not show how to provide custom data source schema while binding to local java-script array.

How do I provide custom data source schema while binding to local java-script array and make code above working for version v2021.2.616?

 

 

Veselin Tsvetanov
Telerik team
 answered on 30 Dec 2021
0 answers
965 views

Im trying to display a kendo.grid after clicking submit. I attached a screenshot so you can understand what Im trying to do.

 

After filling in the information and click submit, I want the information to be displayed below but unfortunately nothing change after I click submit. Only the content in else is displayed

 

This is my code in view

<script>
$(document).ready(function () {
    $("#form").kendoForm({
        validatable: { validationSummary: true },
        orientation: "horizontal",
        formData: ...,
        items: ...,
        submit: function (ev) {
            $.ajax({
                type: "POST",
                url: RootUrl+"Issue/ReportIssue",
            });
        }
    });
    $("#grid").kendoGrid({
        dataSource: {
            data: [
                @if (ViewBag.ReportResult != null)
                {
                    foreach (var item in ViewBag.ReportResult)
                     {
                        @: { col1: '@item.ISSUE_NUM', col2: '@item.PRIORITY', col3: '@item.MODULE', col4: '@item.DESCRIPTION', col5: '@item.REPORTED_DATE', col6: '@item.ISSUE_RESOLUTION', col7: '@item.RESPOND_DATE', col8: '@item.ACTION_TAKEN', col9: '@item.RESOLVED_DATE', col10: '@item.STATUS' },
                     }
                } else
                {
        
                        @: { col1: 'fdfd', col2: 'fd', col3: 're', col4: 'gf', col5: 'hg', col6: 'hy', col7: 'hg', col8: 'jh', col9: 'yt', col10: 'hg' },
                }
            ],
            pageSize: 10
        },
        sortable: true,
        pageable: ...,
        groupable: true,
        filterable: true,
        // columnMenu: true,
        reorderable: true,
        resizable: true,
        selectable: "multiple, row",
        columns: ...
    });
});

Here is my controller. I commented a line in the sql statement(line 24 from bottom). Just ignore that as I dont want to carry two problems at the same time.

[HttpGet]
    public ActionResult ReportIssue()
    {
        if (Session["User_Name"] == null)
            return RedirectToAction("Login", "Account");
        else
        {
            ViewBag.ValidationErrorMsg = "";
            ViewBag.ReportResult = null;
            

            SetUserViewBag();

            return View();
        }
    }

    [HttpPost]
    public ActionResult ReportIssue(string application, string environment, string DateFrom, string DateTo)
    {
        if (Session["User_Name"] == null)
            return RedirectToAction("Login", "Account");
        else
        {
            ViewBag.ValidationErrorMsg = "";
            string get_report_issue = "select " +
                "i.ISSUE_NUM, " +
                "i.PRIORITY, " +
                "i.MODULE, " +
                "CONCAT(i.TITLE, CHAR(13), CHAR(10), i.DESCRIPTION) AS DESCRIPTION, " +
                "CONVERT(VARCHAR(20), i.CREATED_DATE, 103)AS REPORTED_DATE, " + //dd / mm / yyyy 
                "CONCAT(i.ISSUE_TYPE, CHAR(13), CHAR(10), i.ISSUE_CATEGORY, CHAR(13), CHAR(10), i.ISSUE_RESOLUTION) as ISSUE_RESOLUTION, " +
                "CONVERT(VARCHAR(20), " +
                    "( " +
                    "select " +
                        "min(MODIFIED_DATE) " +
                    "from NEPS.dbo.WEBGIS_ISSUE_LOG " +
                    "where " +
                        "i.issue_num = issue_num " +
                        "and FIELD = 'STATUS' " +
                        "and OLD_VALUE = 'NEW'),103 " +
                    ") as RESPOND_DATE, " + //dd / mm / yyyy 
                "STUFF( " +
                    "( " +
                    "SELECT " +
                        "',' + a.NEW_VALUE " +
                    "FROM NEPS.dbo.WEBGIS_ISSUE_LOG a " +
                    "WHERE " +
                        "a.ISSUE_NUM = i.ISSUE_NUM " +
                    "ORDER BY " +
                        "a.NEW_VALUE FOR XML PATH('')), 1, LEN(','), CHAR(13) " +
                    ") AS ACTION_TAKEN, " +
                "CONVERT(VARCHAR(20), ISNULL( " +
                        "( " +
                        "select "  +
                            "max(MODIFIED_DATE) " +
                        "from NEPS.dbo.WEBGIS_ISSUE_LOG " +
                        "where " +
                            "i.issue_num = issue_num " +
                        "and FIELD = 'STATUS' " +
                        "and NEW_VALUE = 'RESOLVED' " +
                        "), " +
                        "( " +
                        "select " +
                            "max(MODIFIED_DATE) " +
                        "from NEPS.dbo.WEBGIS_ISSUE_LOG " +
                        "where " +
                            "i.issue_num = issue_num " +
                        "and FIELD = 'STATUS' " +
                        "and NEW_VALUE = 'CLOSED' " +
                        ") " +
                    ") , 103) AS RESOLVED_DATE, " +
                "i.STATUS " +
            "FROM NEPS.dbo.WEBGIS_ISSUE i " + 
            "LEFT JOIN NEPS.dbo.WEBGIS_ISSUE_LOG C " + 
                "ON i.ISSUE_NUM = C.ISSUE_NUM " +
            "where " +
                "(C.FIELD = 'REMARKS' or C.FIELD = 'STATUS') " +
                //"AND(C.MODIFIED_DATE between " + Convert.ToDateTime(DateFrom).ToString() + " and " + Convert.ToDateTime(DateTo).ToString() + ") " +
                "AND(i.APPLICATION = '" + application + "' OR 'ALL' = '" + application + "' ) " +
                "AND(i.ENVIRONMENT = '" + environment + "' OR 'ALL' = '" + environment + "' ) " +
            "group by " +
                "i.ISSUE_NUM, " +
                "i.PRIORITY, " +
                "i.MODULE, " +
                "i.TITLE, " +
                "i.DESCRIPTION, " +
                "i.CREATED_DATE, " +
                "i.ISSUE_TYPE, " +
                "i.ISSUE_CATEGORY, " +
                "i.ISSUE_RESOLUTION, " +
                "i.STATUS";

            var listReportIssue= db.Database.SqlQuery<ReportIssue>(get_report_issue).ToList();

            return Json(new
            {
                Success = true,
                ListData = listReportIssue
            }, JsonRequestBehavior.AllowGet);
        }
    }

Can you suggest me a solution?

Danish
Top achievements
Rank 1
 asked on 28 Dec 2021
1 answer
568 views

Hi,

I have following situation:

We have desktop application and web application with angularJS and Kendo UI jquery which both use same server REST API. 

If user enters malicious code as string <script>alert("security breach")</script> through desktop application or manually through postman and API, this is saved to the database (we have cases where we have to allow such tags in db). When this is rendered on desktop, it is fine, but when I render Kendo UI tree list - script is rendered and executed.  So, my tree list is displayed, and alert is executed.

I have ngSanitize turned on application wide, but it seems not to be working on kendo ui widgets used within (we combine jquery and angular approach for widgets).

Do you have any suggestions how to approach to this? 

Thank you

Nikolay
Telerik team
 answered on 28 Dec 2021
1 answer
229 views

Hello, I'm using some kendo grids in my application. i need to make them WCAG 2.1 AA compliant.

I use the wave plugin for chrome to see if there are any WCAG errors and its reporting that I have broken aria references on my grid page footer.

this is only happening on some grids so i believe its a setting to do with the grid or the page footer. 

this also happens on your basic demo of the grid

https://demos.telerik.com/kendo-ui/grid/basic-usage

but not the grid overview 

https://demos.telerik.com/kendo-ui/grid/index

 

thanks in advance

Jack

Georgi Denchev
Telerik team
 answered on 28 Dec 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?