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
search option sopt set, nothing happens
15/09/2009
10:56
Avatar
larole
Guest
Guests

Hi,

I'm trying to set the sopt option in my advanced search(also tried simple search) but nothing happens when i try to alter it, im getting default values.

... }, // del options
   {multipleSearch: true,
   sopt: ['cn', 'eq', 'ne']
   } // search options
...

Also tried to set it in colmodel, no luck...

Any idees?

15/09/2009
13:24
Avatar
tony
Sofia, Bulgaria
Moderator
Members

Moderators
Forum Posts: 7721
Member Since:
30/10/2007
sp_UserOfflineSmall Offline

Hello,

Clould you please post the whole code?

Regards

Tony

For professional UI suites for Java Script and PHP visit us at our commercial products site - guriddo.net - by the very same guys that created jqGrid.

16/09/2009
03:10
Avatar
larole
Guest
Guests

    //User Grid
    $("#userlist").jqGrid({
        url: 'GridData',
        datatype: "json",
        mtype: 'POST',
        colNames: [],
        colModel: [
        { name: 'Companyname', index: 'Companyname', hidden: true, formater: 'select', editable: true, edittype: 'select', editrules: { edithidden: 'false', required: 'true'} },
        { name: 'Username', index: 'Username', editable: true, editoptions: { readonly: 'true', size: 25} },
        { name: 'Firstname', index: 'Firstname', editable: true, editoptions: { size: 25 }, formoptions: { elmsuffix: '(*)' }, editrules: { required: 'true'} },
        { name: 'Lastname', index: 'Lastname', editable: true, editoptions: { size: 25 }, formoptions: { elmsuffix: '(*)' }, editrules: { required: 'true'} },
        { name: 'Email', index: 'Email', align: 'left', formater: 'mail', editable: true, editoptions: { size: 25 }, formoptions: { elmsuffix: '(*)' }, editrules: { mail: 'true', required: 'true'} },
        { name: 'Phone', index: 'Phone', align: 'left', editable: true, editoptions: { size: 25 }, formoptions: { elmsuffix: '(*)' }, editrules: { required: 'true', number: 'true'} },
        { name: 'Password', index: 'Password', hidden: true, search:false, edittype: 'password', editable: true, editoptions: { size: 25 }, formoptions: { elmsuffix: '(*)' }, editrules: { edithidden: 'false', required: 'true'} },
        { name: 'ConfirmPassword', index: 'ConfirmPassword', hidden: true, search: false, edittype: 'password', editable: true, editoptions: { size: 25 }, formoptions: { elmsuffix: '(*)' }, editrules: { edithidden: 'false', required: 'true'} },
        { name: 'Country', index: 'Country', align: 'left', formater: 'select', editable: true, edittype: 'select', editrules: { required: 'true'} },
        { name: 'Role', index: 'Role', align: 'left', formater: 'select', editable: true, edittype: 'select', editrules: { required: 'true'} },
        { name: 'Comment', index: 'Comment', sortable: false, editable: true, edittype: 'textarea', editoptions: { rows: '2', cols: '30'} }
        ],
        rowNum: 10,
        rowList: [10, 20, 30],
        imgpath: gridimgpath,
        pager: jQuery('#pagernav'),
        sortname: 'Username',
        viewrecords: true,
        sortorder: "asc",
        caption: "Users",
        editurl: "EditGrid",
        loadComplete: function() {
            var data = $("#userlist").getUserData();
            //console.log(data);

            var myObject = JSON.parse(data);
            //console.log(myObject);

            var roleString = "";
            var countriesString = "";
            var invoicerString = "";
            for (i = 0; i < myObject.Roles.length; i++) {
                //console.log(myObject.Roles[i].Id + ":" + myObject.Roles[i].RoleName + ";");
                roleString += myObject.Roles[i].Id + ":" + myObject.Roles[i].RoleName + ";";
            }

            for (i = 0; i < myObject.Invoicers.length; i++) {
                //console.log(myObject.Invoicers[i].CompanyName);
                invoicerString += myObject.Invoicers[i].Id + ":" + myObject.Invoicers[i].CompanyName + ";";
            }

            for (i = 0; i < myObject.Countries.length; i++) {
                //console.log(myObject.Countries[i].Country);
                countriesString += myObject.Countries[i].Id + ":" + myObject.Countries[i].Country + ";";
            }
            //console.log(roleString);
            //console.log(countriesString);
            //console.log(invoicerString);

            $("#userlist").setColProp('Country', { editoptions: { value: countriesString} });
            $("#userlist").setColProp('Role', { editoptions: { value: roleString} });
            $("#userlist").setColProp('Companyname', { editoptions: { value: invoicerString} });

            $("#sg_search").keypress(doSearch);

        }
    }).navGrid('#pagernav',
                        { edit: true, add: true, del: true, search: true }, //options
                        {height: 400,
                        width: 600,
                        closeAfterAdd: true,
                        closeAfterEdit: true,
                        modal: true,
                        beforeShowForm: function(form) {
                            $('#tr_Password').hide();
                            $('#tr_ConfirmPassword').hide();
                            $('#tr_Companyname').hide();
                            $("#Username.FormElement").attr('readonly', 'true');
                        },
                        afterSubmit: onAfterSubmit
                    }, // edit options
                        {height: 400,
                        width: 600,
                        closeAfterAdd: true,
                        closeAfterEdit: true,
                        modal: true,
                        beforeShowForm: function(form) {
                            $('#tr_Password').show();
                            $('#tr_ConfirmPassword').show();
                            $('#tr_Companyname').show();
                            $("#Username.FormElement").removeAttr('readonly');
                            //cant find the div generation of the dialog, and a css height 'bug' had to be removed. the bug is probably related with the modification of form fields
                            $("#editmoduserlist").attr("style", "overflow: hidden; top: 90px; left: 51px; width: 600px; z-index: 950; display: block;");
                        },
                        afterSubmit: onAfterSubmit
                    }, // add options
                        {modal: true,
                        afterSubmit: onAfterSubmit
                    }, // del options
                        {multipleSearch: false,
                        recreateFilter: true,
                        sopt: ['cn', 'eq', 'ne']
                    } // search options
                        );

18/09/2009
03:51
Avatar
tony
Sofia, Bulgaria
Moderator
Members

Moderators
Forum Posts: 7721
Member Since:
30/10/2007
sp_UserOfflineSmall Offline

Hello,

IMHO all is correct and should work except that multipleSearch is available only in 3.5 version.

Regards

Tony

For professional UI suites for Java Script and PHP visit us at our commercial products site - guriddo.net - by the very same guys that created jqGrid.

19/09/2009
01:52
Avatar
Matthijs
Guest
Guests

Yup, same issue here.

I am also trying to just use one or two search options; but nothing happens; I always get the default set of options.

Is there a working exampe online who has less search options? Then I can compare that one with mine and see what I have done wrong.

Thanks a lot!

Matthijs

19/09/2009
08:19
Avatar
tony
Sofia, Bulgaria
Moderator
Members

Moderators
Forum Posts: 7721
Member Since:
30/10/2007
sp_UserOfflineSmall Offline

Hello,

Thanks. Finally found the problem.

The fix is in GitHub. Also fixed some issues when IE7 or IE6 are used and we search with more than two fields

Best Regards

Tony

For professional UI suites for Java Script and PHP visit us at our commercial products site - guriddo.net - by the very same guys that created jqGrid.

Forum Timezone: Europe/Sofia

Most Users Ever Online: 715

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