Telerik Forums
Kendo UI for jQuery Forum
5 answers
1.9K+ views

I am using the following JSON data in my Kendo ListView DataSource:

[
  {
    "Id": 2,
    "Name": "My Name",
    "Address": "123 Sesame Street",
    "City": "My City",
    "State": "MO",
    "ProductTypes": [
      {
        "Id": 2,
        "Name": "Cage Free"
      },
      {
        "Id": 3,
        "Name": "Free-Trade"
      },
      {
        "Id": 4,
        "Name": "GAP"
      },
      {
        "Id": 6,
        "Name": "Grass Fed"
      }
    ]
  }
]

 

Now here is my goal/issue. I would like to filter the datasource when a checkbox is checked and the field I would like to filter by is the `ProductTypes.Name` field.

However, I'm not sure how to get this working correctly.

Here is my DataSource:

profileDataSource: new kendo.data.DataSource({
    transport: {
        read: {
            url: "/Profile/GetAllProfiles",
            dataType: "json"
        }
    },
    schema: {
        model: {
            fields: {
                Id: { type: "number", editable: false, nullable: true },
                Name: { type: "string" },
                ProductTypes_Name: { type: "string", from: "ProductTypes.Name" }
            }
        }
    }
})

 

And here is how I'm currently trying to filter but it's not working:

$("#profileCertificationsListView").on("click", "input[type=checkbox]", function() {
    viewModel.profileDataSource.filter({
        filters: [
            { field: "ProductTypes_Name", operator: "eq", value: $(this).attr("name") }
        ]
    }
});

 

If I check the checkbox that has the name "Cage Free" for example, all of the items in the listview are hidden.

Misho
Telerik team
 answered on 10 Dec 2020
5 answers
432 views
I have a grid that has a few column templates defined.  Some are using data-bind="click: clickHandler" and some have custom and kendo widgets within them.  When I use a DataSource making a remote data call, it seems like the kendo.bind() is not being applied to the rows in the column.

JS Fiddle example here which has an "Action" column with a simple data-bind click handler that will not fire:
http://jsfiddle.net/jeastburn/VgtDM/

I found I can call kendo.bind() on the dataBound Grid event, but this feels like a hack and I lose the ability to have data-bind events pass the row data rather than my top-level Observable object I use in the bind() call..
Ivan Danchev
Telerik team
 answered on 10 Dec 2020
3 answers
253 views

I'm totally new to Telerik and the example that I want to build upon is defined in this style:

        <kendo-grid name="grid" height="550">
            <columns>
                <column field="Facility_Id" title="Facility"/>
                <column field="Name" title="Name"/>

when I look for hints on what is possible, I find only this style:

        $(document).ready(function () {
            var grid = $("#grid").kendoGrid({
                columns: [
                    { field: "FirstName", title: "First Name", width: "140px" },
                    { field: "LastName", title: "Last Name", width: "140px" },
                    { field: "Title" },
                    { command: { text: "View Details", click: showDetails }, title: " ", width: "180px" }]
            }).data("kendoGrid");

 

Which is the preferred one and where do I find examples for the first style please?

Thanks

Aleksandar
Telerik team
 answered on 10 Dec 2020
3 answers
241 views
I have the following:

@(Html.Kendo().ListView<CourseServiceModel.CourseSearchResult>(Model)
       .Name("CourseListView")
       .TagName("div")
       .ClientTemplateId("template")
       .DataSource(dataSource =>
       {
       dataSource.Read(read => read.Action("GetSearchedCourses", "SearchCourse").Data("getSortBy"));
       dataSource.PageSize(10);
   })
       .Pageable(x => x.PageSizes(true).Refresh(true).Info(true).PageSizes(new int[]{10,25,50}))
     )

On the first time the page loads, the datasource is read as expected. On subsequent post the datasource does not get read, no ajax calls.

Works fine in FF and Chrome only an issue in IE (8,9).

Sounds like a caching issue but not sure where to start....

The page navigation is <page to set search criteria> -> RedirectToRoute("Results") -> <Results (contains ListView)> 


Stuart
Top achievements
Rank 1
 answered on 10 Dec 2020
3 answers
523 views

I have been doing a static code analysis of my entire project with the KIUWAN tool

This tool has found some security issues in some Kendo JS files

I would like to know if they are false positives or if it can be justified in some way that there are no security problems

Problems found (the most important are the first 3):

  • Do not update control vars in 'for' loop body Maintainability Control flow
  • Potential denial-of-service attack through malicious regular expression(ReDoS)
  • Never use JavaScript 'history' object or navigation-based positioning
  • Avoid unused local variable 
  • Avoid accessing unreliable variable properties 
  • Standard pseudo-random number generators cannot withstand cryptographic attacks

    The details of the analysis are in the attached file (a zip with a pdf file)

Kendo version: 2020.2.513

 

Francisco
Top achievements
Rank 1
 answered on 10 Dec 2020
1 answer
233 views

Hi, we need to use the setOptions function when we resize the window, to set the new gantt height.

We also use the "resizable" property.

The problem is, after a "column resize", the inner "option" column width is not set to the object.

So, when we use setOptions, the columns size are back to original.

We found a workaround, where we edit the inner option column size property after a "colunnResize" event, but I think that it's a bug and it should be done by the component itself automatically.

https://dojo.telerik.com/@foxontherock/uCulUjiy/6

I also tried to keep the "listWidth" by binding the "resize" event of the inner splitbar, but I think it's not a kendo splitter, but a custom spliter made just for the gantt, and it doesn't work.

Nencho
Telerik team
 answered on 09 Dec 2020
6 answers
247 views

We’re using the Kendo Grid and need to  make it  ADA compliant . We're using a tool called JAWS for verifying the ADA compliance.
Below are some of the issues we noticed:

1) How can we set focus on the Edit popup screen from kendo grid?

2) Say once the focus is set on Edit popup form ;How can we navigate to the other controls on the popup screen ?

3) How can we exit out of the edit popup screen and set focus back to the main grid ?  

 

Thanks,

Prasuna

Angel Petrov
Telerik team
 answered on 09 Dec 2020
1 answer
303 views

Hi ,

We are working on the requirement in which we need to provide more options/bullets for ordered list or for unordered list like we have multiple options in MS word.

Also i find same think in richtext editor https://richtexteditor.com/ where we can have such options in the form of dropdown list, Is it possible with Kendo Editor as we have license for Kendo ?

 

 

 

 

Thanks,

AK

Aleksandar
Telerik team
 answered on 09 Dec 2020
5 answers
975 views
Recently upgraded from kendo 2016 to 2020, I no longer able to see the class k-invalid-msg in content/kendo. If its removed in latest kendo what is the alternate?
Stoyan
Telerik team
 answered on 09 Dec 2020
1 answer
204 views

Hi devs and support.

I'm using the grid search panel in a grid toolbar template (https://www.telerik.com/forums/search-panel-and-toolbar-template)

If the user paste "1234 " (with a trailing space) into the search input box the row with id="1234" is not found.

Is there a clever way to do a .trim() before the entered/pasted value is used to search the data?

 

Best regards

Morten

Nikolay
Telerik team
 answered on 08 Dec 2020
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
Drag and Drop
Application
Map
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
Chat
MultiColumnComboBox
Dialog
DateRangePicker
Checkbox
Timeline
Drawer
DateInput
ProgressBar
MediaPlayer
ImageEditor
TextBox
OrgChart
Accessibility
Effects
PivotGridV2
Licensing
ScrollView
Switch
TextArea
BulletChart
QRCode
ResponsivePanel
Wizard
CheckBoxGroup
Localization
Barcode
Breadcrumb
Collapsible
MultiViewCalendar
Touch
RadioButton
Stepper
Card
ExpansionPanel
Rating
RadioGroup
Badge
Captcha
Heatmap
AppBar
Loader
Security
TaskBoard
Popover
DockManager
TimePicker
FloatingActionButton
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
StockChart
ContextMenu
DateTimePicker
RadialGauge
ArcGauge
AICodingAssistant
SmartPasteButton
PromptBox
SegmentedControl
+? more
Top users last month
Simon
Top achievements
Rank 2
Iron
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Simon
Top achievements
Rank 2
Iron
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?