Forum

November 2nd, 2014
A A A
Avatar

Lost password?
Advanced Search

— Forum Scope —




— Match —





— Forum Options —





Minimum search word length is 3 characters - maximum search word length is 84 characters

The forums are currently locked and only available for read only access
sp_Feed Topic RSS sp_TopicIcon
JQGrid Populate tblHardware.BrandID - Master Detail Form
04/01/2013
09:37
Avatar
micnie2020
Member
Members
Forum Posts: 30
Member Since:
21/02/2012
sp_UserOfflineSmall Offline

Hi All,

I have JQGRID as below, when i select TypeID, onchange will fill in the BrandID. But unfortunately i can't fill in the value due to my BrandID name: 'tblHardware.BrandID'.

{ name: 'TypeID', index: 'TypeID', resizeToTitleWidth: true, align: 'left', editable: true, viewable: false, edittype: 'select', editoptions: { dataUrl: '@Url.Content("~/Home/TypeSelect?grid=MasterGeneralAsset&module=")@Session["module"]&EntityID=@Session["LegalEntity"]', buildSelect: function (data) {
                              var field_id = this.id; // "myDropDown"
                              setTimeout(function () {
                                  if (needDisable) {
                                      $('#tr_' + field_id).attr('disabled', 'disabled');
                                  } else {
                                      $('#tr_' + field_id).removeAttr('disabled');
                                      $("#TypeID").attr("onchange", function () {
                                          var f = this.value;
                                          var e = $("#EntityID").val();
                                          //alert(e);
                                          $.post('@Url.Content("~/Home/getRate")', { TypeID: f, EntityID: e },
                                            function (data) {
                                                $("#MethodID").attr("value", data[0].MethodID);
                                                $("#Rate").attr("value", data[0].Rate);
                                            });
                                          var plazosHtml = "";
                                          $.post('@Url.Content("~/Home/BrandSelectByEntityID")', { TypeID: f },
                                            function (data2) {
                                                $("select[id$=tblHardware.BrandID] > option:gt(0)").remove();

                                                for (i = 0; i < data2.length; i++) {
                                                    plazosHtml += '<option value="' + data2[i].BrandID + '">' + data2[i].Description + '</option>';
                                                }
                                                $("#tblHardware.BrandID").append(plazosHtml);

                                            });

                                      });
                                  }
                              }, 100);
                              return data;
                          },
                              dataEvents: [
                        { type: 'change', fn: function (e) {
                            var f = e.currentTarget.value;
                            var plazosHtml = "";
                            $.post('@Url.Content("~/Home/BrandSelectByEntityID")', { TypeID: f },
                                            function (data2) {
                                                $("select[id$=tblHardware.BrandID] > option:gt(0)").remove();

                                                for (i = 0; i < data2.length; i++) {
                                                    plazosHtml += '<option value="' + data2[i].BrandID + '">' + data2[i].Description + '</option>';
                                                }

                                                $("#tblHardware.BrandID").append(plazosHtml);
                                            });
                        }
                        }]
                          }, hidden: true, editrules: { edithidden: true, required: true }, formoptions: { rowpos: 5, colpos: 1, elmsuffix: '<font color="red">*</font>' }, search: true, sortable: true, searchoptions: { sopt: ['eq']}
                          },

{ name: 'tblHardware.BrandID', index: 'tblHardware.BrandID', resizeToTitleWidth: true,  align: 'left', editable: true, viewable: false, edittype: 'select', editoptions: { dataUrl: '@Url.Content("~/Home/BrandSelect?gTypes=MasterGenAsset")', buildSelect: function (data) {
                          var field_id = this.id; // "myDropDown"
                          setTimeout(function () {
                              if (needDisable) {
                                  $('#tr_' + field_id).attr('disabled', 'disabled');
                              } else {
                                  $('#tr_' + field_id).removeAttr('disabled');                                 
                                  $("#BrandID").attr("onchange", function () {
                                        var f = this.value;
                                        alert("f");
                                        var plazosHtml = "";
                                        $.post('@Url.Content("~/Home/ModelSelectByBrandID")', { BrandID: f },
                                        function (data2) {
                                         $("select[id$=ModelID] > option:gt(0)").remove();

                                            for(i=0; i<data2.length; i++)
                                            {
                                                plazosHtml += '<option value="' + data2[i].ModelID + '">' + data2[i].Description + '</option>';
                                            }
                                        
                                          
                                            $("#ModelID").append(plazosHtml);
                                          
                                        });
                                       
                                  });
                              }
                          }, 100);
                          return data;
                      },                    
                dataEvents :[
                    { type: 'change', fn: function(e) {
                          var f = e.currentTarget.value;
                          var plazosHtml = "";
                                        $.post('@Url.Content("~/Home/ModelSelectByBrandID")', { BrandID: f },
                                        function (data2) {
                                         $("select[id$=ModelID] > option:gt(0)").remove();

                                            for(i=0; i<data2.length; i++)
                                            {
                                                plazosHtml += '<option value="' + data2[i].ModelID + '">' + data2[i].Description + '</option>';
                                            }
                                        
                                            $("#ModelID").append(plazosHtml);                                            
                                        });
                           }
                        }]
                      }, hidden: true, editrules: { edithidden: true, required: true }, formoptions: { rowpos: 17, colpos: 1, elmsuffix: '<font color="red">*</font>'}, search: true, sortable: true
                      },

Can anyone help me?

Thank you.

Regards,

Micheale

Forum Timezone: Europe/Sofia

Most Users Ever Online: 715

Currently Online:
33 Guest(s)

Currently Browsing this Page:
1 Guest(s)

Top Posters:

OlegK: 1255

markw65: 179

kobruleht: 144

phicarre: 132

YamilBracho: 124

Renso: 118

Member Stats:

Guest Posters: 447

Members: 11373

Moderators: 2

Admins: 1

Forum Stats:

Groups: 1

Forums: 8

Topics: 10592

Posts: 31289

Newest Members:

, razia, Prankie, psky, praveen neelam, greg.valainis@pa-tech.com

Moderators: tony: 7721, Rumen[Trirand]: 81

Administrators: admin: 66

Comments are closed.
Privacy Policy   Terms and Conditions   Contact Information