This is a migrated thread and some comments may be shown as answers.

Getting name of dropdown menu that filters grid

2 Answers 40 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Catherine
Top achievements
Rank 1
Catherine asked on 26 Jun 2018, 09:10 PM

Hi, I'm currently trying to filter a grid using an external component like the dropdown menu. I've used the instructions found in this form thread.
How would I pass the name of the drop down menu as well as the id or text data associated with the selection.
For example here is my current code:

Javascript

<script>
    var menuName
    var menuItem
 
    function additionalData(e) {
        return {
            item: menuName + " " + menuItem
        }
    }
 
    function onChange(e) {
         //What would I put here to get the name or id of the dropdown? id, name, &ct.toString() do not work
        menuName = this.name()
        menuItem = this.text()
 
        var grid = $("#analogGrid").data("kendoGrid")
        grid.dataSource.read()
    }
</script>


Grid HTMLHelper

//...
.Read(read => read.Action("Analogs_ReadAsync", "Analogs").Data("additionalData"))
//...


Controller Action

public async Task<JsonResult> Analogs_ReadAsync([DataSourceRequest]DataSourceRequest request, string item) {...}

2 Answers, 1 is accepted

Sort by
0
Accepted
Alex Hajigeorgieva
Telerik team
answered on 29 Jun 2018, 01:38 PM
Hello, Catherine,

I have just seen that you found my answer helpful to the same question in the forum thread at:

https://www.telerik.com/forums/getting-name-of-dropdown-menu-that-filters-grid

Can you let me know if this is a different question in any way or shall I consider it resolved?

Let me know if you need more help. 

Kind Regards,
Alex Hajigeorgieva
Progress Telerik
Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
0
Catherine
Top achievements
Rank 1
answered on 02 Jul 2018, 01:21 PM
Yes, thank you again. I didn't realize you could move my original post to the correct form so I reposted it here before I saw that you had moved it.
Tags
Grid
Asked by
Catherine
Top achievements
Rank 1
Answers by
Alex Hajigeorgieva
Telerik team
Catherine
Top achievements
Rank 1
Share this question
or