jQuery UI Widgets Forums General Discussions Lists DropDownList Changing content of dropdownbutton

This topic contains 3 replies, has 2 voices, and was last updated by  jccompagnon 10 years, 6 months ago.

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
  • Changing content of dropdownbutton #64912

    jccompagnon
    Participant

    A grid cell in the filter row contains a dropdown list. The button content is “Select Filter” and I want to change it to “Select.” Would I use the setContent method to do this? Would I have to use a localizationobj function. As a noob I’m not sure how or where.

    What I have now:

    var getLocalization = function () {
    	var localizationobj = {};
            localizationobj.filterselectstring="Select";
    }; 
    			
                // initialize jqxGrid
                $("#jqxgrid").jqxGrid(
                {
                    width: '100%',
                    theme: KiouiTheme,
                    source: dataAdapter,                 
                    pageable: true,
                    autoheight: true,
                    sortable: true,
                    altrows: true,
                    enabletooltips: true,
                    pagesizeoptions: ['100', '200', '300'],
                    filterable: true,
                    showfilterrow: true, 
    		localization: getLocalization(),
                    selectionmode: 'singlerow',
    		enablebrowserselection: true,
    		selectionmode: 'singlecell',
    
    		theme: 'kioui',
                    columns: [
                      { text: 'Date (PST)', datafield: 'TimeStamp', type: 'date', cellsformat: DateTimeFomat,width:'10%' },
                      { text: 'Retries', datafield: 'Retries' ,width:'10%', filtertype: 'checkedlist'},
                      { text: 'Comment', datafield: 'ProcessingComment' ,width:'20%'},
                      { text: 'From', datafield: 'From' ,width:'12%'},
                      { text: 'To', datafield: 'To' ,width:'12%'},
                      { text: 'Subject',  datafield: 'Subject' ,width:'20%'},
                      { text: 'Error',  datafield: 'Error' ,width:'16%'},
                     ],
                   
    			   
                });
    Changing content of dropdownbutton #64914

    Peter Stoev
    Keymaster

    Hi jccompagnon,

    You can’t use “setContent” because there isn’t such method. I would suggest you to look at the Grid’s Localization demos and Localization help topic. Each string in jqxGrid can be changed.

    Best Regards,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com/

    Changing content of dropdownbutton #64915

    jccompagnon
    Participant

    I did look at those demos and topics and they helped me come up with the code above. Do you see anything specifically wrong with my code?

    Changing content of dropdownbutton #64917

    jccompagnon
    Participant

    Got it to work with a bindingcomplete event instead of creating a function and calling it in the appearance parameters. I had tried it several times but it never worked because this:

    $("#jqxgrid").bind("bindingcomplete", function () {
    	var localizationobj = {};
    	localizationobj.filterselectstring = "Select";
    	$("#jqxgrid").jqxGrid('localizestrings', localizationobj);
    });

    is different from this:

    $("#jqxgrid").bind(“bindingcomplete”, function () {
    	var localizationobj = {};
    	localizationobj.filterselectstring = "Select";
    	$("#jqxgrid").jqxGrid('localizestrings', localizationobj);
    });

    The latter sample has “fancy” quotation marks around “bindingcomplete” that I picked up from here:
    http://www.jqwidgets.com/community/topic/bindingcomplete-jqxgridfocus/

Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.