Click here to Skip to main content
15,886,873 members
Home / Discussions / ASP.NET
   

ASP.NET

 
GeneralRe: Asp.Net MVC Pin
Ankit Bopche28-Mar-18 8:34
Ankit Bopche28-Mar-18 8:34 
GeneralRe: Asp.Net MVC Pin
Richard Deeming28-Mar-18 9:05
mveRichard Deeming28-Mar-18 9:05 
QuestionEnable Image Zoom only Pin
sunsher28-Mar-18 3:24
sunsher28-Mar-18 3:24 
AnswerRe: Enable Image Zoom only Pin
User 418025431-Mar-18 15:20
User 418025431-Mar-18 15:20 
QuestionHttpCookie vs Cookie, and multi-value HttpCookie Pin
jkirkerx25-Mar-18 12:55
professionaljkirkerx25-Mar-18 12:55 
AnswerRe: HttpCookie vs Cookie, and multi-value HttpCookie Pin
Richard Deeming26-Mar-18 8:37
mveRichard Deeming26-Mar-18 8:37 
GeneralRe: HttpCookie vs Cookie, and multi-value HttpCookie Pin
jkirkerx5-Apr-18 12:24
professionaljkirkerx5-Apr-18 12:24 
QuestionNeed to loop through Kendo grid to get the selected value of all the Dropdowns in the Grid Pin
indian14320-Mar-18 14:09
indian14320-Mar-18 14:09 
Hi,

I have a Kendo grid I am have a dropdown as the first element of it, I want to get the selected text or value of those all drop downs if they are selected. If they are not selected there is no need to count them.

I am using jQuery to do it, tried many options so far there is no luck. Grid is very big, hence I am just putting only the code where I am trying to access it.
This is is how I am trying it, so far no luck, any help would be very helpful, thanks in advance.
 var grid = $( "#budgetdGrid" );

        var dataSource = grid.dataSource;
        var columns = $("#budgetdGrid").data("kendoGrid").columns;
        var rows = $("#budgetdGrid").data("kendoGrid").rows;

        var noOfCols = columns.length;

        grid.items().each(function(a) {
               alert(a.text())
        });

I am trying to access it within this function:
    function onLineDropDownChange(e) {<br />
        //alert(e.sender.select())
        //alert(e.sender.text());

        var grid = $( "#budgetdGrid" );

        var dataSource = grid.dataSource;
        var columns = $("#budgetdGrid").data("kendoGrid").columns;
        var rows = $("#budgetdGrid").data("kendoGrid").rows;

        var noOfCols = columns.length;

        grid.items().each(function(a) {
               alert(a.text())
        });

        //alert(e.sender.select().val())
        //rows.each(function(e) {
        //    var grid = $("#budgetdGrid").data("kendoGrid");
        //    var dataItem = grid.dataItem(this);

        //    alert(dataItem);
        //})

        var tr = this.element.closest("tr");
        var line_no="";
        var prev_line = [];
        //    var line_arr = ['200', '201', '101a-cw', '101a-mc', '70p-cw', '70p-mc'];
        var lin_val = tr.find("input[id^='inputLine_']").val();
        if ( lin_val != "" && lin_val != 'undefined') {
            line_no = tr.find("input[id^='inputLine_']").data("kendoDropDownList").text().substr(0, tr.find("input[id^='inputLine_']").data("kendoDropDownList").text().indexOf('('));
        }
        if (lin_val != '' && line_no != '') {
            $("#doeGrid").find("#budgetdGrid  tbody").find('tr').each(
            function () {
                var id = $(this).find("input[id^='inputLine_']").val();
                if (id == lin_val && lin_val != "" && id != "") {
                    prev_line.push(id);
                }
            });
            if (prev_line.length > 1) {
                alert("You have already selected the Line Item in the previous rows");
            }
            else {

                if ((line_no.substr(0, line_no.indexOf('-')) == '200') || (line_no.substr(0, line_no.indexOf('-')) == '201') || (line_no == '101a-cw') ||
                    (line_no == '101a-mc') || (line_no == '70p-cw') || (line_no == '70p-mc') || (line_no.substr(0, line_no.indexOf('-')) == '202' && '@Session["FiscalYearCode"]'=='FY 2015-2016')||
                    (line_no.substr(0, line_no.indexOf('-')) == '204' && '@Session["FiscalYearCode"]'=='FY 2015-2016')||
                    (line_no.substr(0, line_no.indexOf('-')) == '203' && '@Session["FiscalYearCode"]'=='FY 2015-2016') ||
                    (line_no.substr(0, line_no.indexOf('-')) == '205' && '@Session["FiscalYearCode"]'=='FY 2015-2016'))
                    //if (containsLine(line_no, line_arr))
                {
                    if (containsAny('@Model.Service_Code', [30, 33, 34, 43, 51, 52]) && '@Model.Program_Code' >= 87) {
                        tr.find("input[name^='txt_budgt']").removeAttr("disabled = 'disabled'");
                        tr.find("input[name=txt_IndivUOS]").removeAttr("disabled = 'disabled'");
                    }
                    else if (('@Model.Service_Code' == 48 && '@Model.Program_Code' >= 87)) {
                        tr.find("input[name^='txt_budgt']").removeAttr("disabled = 'disabled'");
                        tr.find("input[name=txt_IndivUOS]").removeAttr("disabled = 'disabled'");
                        tr.find("input[name=txt_NtpGrp]").removeAttr("disabled = 'disabled'");
                        tr.find("input[name=txt_NtpDos]").removeAttr("disabled = 'disabled'");
                    }
                    else {
                        tr.find("input[name^='txt_budgt']").removeAttr("disabled = 'disabled'");
                    }
                }
                else if (('@Session["FiscalYearCode"]'=='FY 2016-2017') || ('@Session["FiscalYearCode"]'=='FY 2017-2018'))
                {
                    tr.find("input[name^='txt_dirCst']").removeAttr("disabled = 'disabled'");
                }
                else {
                    tr.find("input[name^='txt_budgt']").removeAttr("disabled = 'disabled'");
                }
            }           
        }
        else {
            alert("Please Choose Proper Line Item");
        }
    }

This function will be called when there is any change in the Grid, onchange but when change occurs it has to loop through the whole grid and then find out the selected text or values of the dropdowns then it will be acted upon the selected items of the dropdowns.

Please any help would be very very supportive - thanks in advance.

Thanks,

Abdul Aleem

"There is already enough hatred in the world lets spread love, compassion and affection."
AnswerRe: Need to loop through Kendo grid to get the selected value of all the Dropdowns in the Grid Pin
Vincent Maverick Durano20-Mar-18 17:40
professionalVincent Maverick Durano20-Mar-18 17:40 
GeneralRe: Need to loop through Kendo grid to get the selected value of all the Dropdowns in the Grid Pin
indian14320-Mar-18 20:44
indian14320-Mar-18 20:44 
GeneralRe: Need to loop through Kendo grid to get the selected value of all the Dropdowns in the Grid Pin
Richard Deeming21-Mar-18 9:24
mveRichard Deeming21-Mar-18 9:24 
GeneralRe: Need to loop through Kendo grid to get the selected value of all the Dropdowns in the Grid Pin
indian14321-Mar-18 10:07
indian14321-Mar-18 10:07 
GeneralRe: Need to loop through Kendo grid to get the selected value of all the Dropdowns in the Grid Pin
indian14321-Mar-18 7:29
indian14321-Mar-18 7:29 
Questionhow to find a running total in a gridView templateField Pin
Member 933127820-Mar-18 12:40
Member 933127820-Mar-18 12:40 
AnswerRe: how to find a running total in a gridView templateField Pin
Vincent Maverick Durano20-Mar-18 17:35
professionalVincent Maverick Durano20-Mar-18 17:35 
QuestionPage.RegisterStartupScript Method Pin
A_Griffin16-Mar-18 2:23
A_Griffin16-Mar-18 2:23 
AnswerRe: Page.RegisterStartupScript Method Pin
Richard Deeming16-Mar-18 2:46
mveRichard Deeming16-Mar-18 2:46 
GeneralRe: Page.RegisterStartupScript Method Pin
A_Griffin16-Mar-18 2:54
A_Griffin16-Mar-18 2:54 
AnswerRe: Page.RegisterStartupScript Method Pin
F-ES Sitecore19-Mar-18 0:24
professionalF-ES Sitecore19-Mar-18 0:24 
QuestionSCHEDULER IN VISUAL STUDIOS Pin
Faisal716-Mar-18 1:26
Faisal716-Mar-18 1:26 
AnswerRe: SCHEDULER IN VISUAL STUDIOS Pin
Vincent Maverick Durano20-Mar-18 17:57
professionalVincent Maverick Durano20-Mar-18 17:57 
GeneralRe: SCHEDULER IN VISUAL STUDIOS Pin
Faisal721-Mar-18 3:00
Faisal721-Mar-18 3:00 
GeneralRe: SCHEDULER IN VISUAL STUDIOS Pin
Charlie brown 7113-Apr-18 0:35
Charlie brown 7113-Apr-18 0:35 
QuestionDomain driven design pattern and onion architecture is same or different Pin
Mou_kol13-Mar-18 22:05
Mou_kol13-Mar-18 22:05 
AnswerRe: Domain driven design pattern and onion architecture is same or different Pin
Bohdan Stupak20-Mar-18 4:48
professionalBohdan Stupak20-Mar-18 4:48 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.