Forum

July 12th, 2025
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
(Help pls)how to change editoptions data Url on event change?
18/09/2011
06:48
Avatar
Candrairawan78
Indonesia
Member
Members
Forum Posts: 39
Member Since:
30/01/2010
sp_UserOfflineSmall Offline

Dear guys,

I have 2 select combobox on edit form

I want to change 2nd combobox`s editoptions data Url when the value of 1st combobox change

Could you please guide me how to do it?

Here is my code:

var mygrid =
    jQuery("#list").jqGrid({
    url:'tabel/tablejson.php?q=1',
    datatype: 'json', <!--Defines what type of information to expect to represent data in the grid.-->
    mtype: "POST",
    colNames:['Type','Supplier'],
    colModel :[        

       {name:'type' , index:'type' , width:70, align:'right', stype:'select' , editable:true, edittype:"select", editoptions:

       {value:":All;free:free;paid:paid"}, formoptions:{elmprefix:"(*)"}, formatter:'select'},  
     

        {name:'supplier'  , index:'supplier'  , width:75, editable:true, editoptions:{size:25}, editrules:{required:true},

        edittype:"select", editoptions:{dataUrl:'filterselect/filterselectsupplierfree.php'}, formoptions:{elmprefix:"(*)",elmsuffix:"  supplier name"}, sortable:true, stype:'select', search:true, searchoptions:{dataUrl:'filterselect/filterselectsupplierfree.php'}}

    ],
    multiselect: true,
    altRows: true,
    pager: '#pager',
    rowNum:200,
    rownumbers: true,
    gridview: true,
    height: 191,
    width: 1350,
    rowList:[200,300,500],
    sortname: 'date',
    sortorder: 'asc',
    viewrecords: true,
    caption: 'DATA', <!--Defines the Caption layer for the grid.-->
    editurl:"edit/editjson.php"

    });

jQuery("#list").jqGrid('navGrid','#pager',{edit:true, edittext:'Edit',add:false,del:false,search:false, refresh:false, view:false},
{jqModal:true, top: 120, left: 480, width: 350, drag:false, resize:false, reloadAfterSubmit:true, closeOnEscape:true, checkOnUpdate:true, savekey: [true,13], navkeys: [true,38,40], checkOnSubmit : true, closeAfterEdit:true,
        onInitializeForm : function (formid){
        $("#type",formid).change(function() {
        var kk = $("#type",formid).val() ;  
        if (kk == 'free') {  
          $("#list").setColProp('supplier', { editoptions:{dataUrl:'filterselect/filterselectsupplierfree.php'} });
        } else {
          $("#list").setColProp('supplier', { editoptions:{dataUrl:'filterselect/filterselectsupplierpaid.php'} });
        }
    
        }  
    );
        }
  },// edit options

Thank you for your help

Candra

Forum Timezone: Europe/Sofia

Most Users Ever Online: 994

Currently Online:
19 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