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
Problems mit dynamic Edit Fields
08/10/2009
06:50
Avatar
Patrick
Guest
Guests

Hi all,

i want to dynamically add a second password field to the edit window. Problem is, that the field is set to the end of the table and marked "hidden". Any clues?

Thx in advance.

Tried this code:

jQuery(”#userTable”).jqGrid({
        url: _gridUrl,
        datatype: _datatype,
        colNames:['ID','Account-Name','Passwort','Nachname','Vorname','Strasse','PLZ','Ort','Telefon','Fax','email','inaktiv'],
        colModel:[
            {name:'id',index:'id', width:67, align:"center"},
            {name:'name',index:'name', editable: true, width:120, editrules:{required:true}},
            {name:'password',index:'password', editable: true, edittype:'password', hidden: true, editrules:{required:true, edithidden: true}},               
            {name:'Nachname',index:'Nachname', width:100, editable: true},
            {name:'Vorname',index:'Vorname', width:100, editable: true},
            {name:'Strasse',index:'Strasse', width:100, editable: true},
            {name:'PLZ',index:'PLZ', width:67, editable: true},
            {name:'Ort',index:'Ort', width:100, editable: true},
            {name:'Telefon',index:'Telefon', width:67, editable: true},
            {name:'Fax',index:'Fax', width:67, editable: true},
            {name:'Email',index:'Email', width:67, editable: true},
            {name:'inaktiv',index:'inactive', width:67, align:"center", editable: true,
                edittype:'checkbox', formatter:'checkbox', editoptions: {value:"1:0"}}
        ],
        pager: jQuery('#userPagernav'),
        width: 500,
        height: 259,
        recordpos: 'center',
        pagerpos: 'hidden',
        shrinkToFit: false,
        gridview: true,
        sortname: 'id',
        viewrecords: true,
        sortorder: “asc”,
        multiselect: false,
        onsetselection: true,
        scrollrows: true,
        viewsortcols: true,
        rownumbers: true,
        rowNum: 99999999,
        loadui: 'block',
        gridComplete: function(id)
        {
            gridComplete();
        },
        onSelectRow: function(id)
        {
            setCookies();
        },
        onSortCol: function(id)
        {
            sort_change = true;
            setCookies();
        },
        editurl:”files/ajax/reqUserUpdate.php”
    }).navGrid('#userPagernav',
        {
            edit:true,
            add:true,
            search:true,
            del:false,
            refresh:true,
            addtitle: “Neuen ” + gridName + ” anlegen”,
            edittitle: “Ausgewaehlten ” + gridName + ” editieren”,
            searchtitle: gridName + ” finden”
        }, //options
        {
            height:320,
            width:500,
            reloadAfterSubmit:true,
            editCaption: gridName + ” editieren”,
            beforeShowForm: function(formid) {
                var my_field_pos = $(”#password”,formid).parent(”tr:first”);
                var elm = “<tr class='FormData'><td class='CaptionTD ui-widget-content'>MyCaption</td><td class='DataTD ui-widget-content'><input class='FormElement'/></td></tr>”;
                $(my_field_pos).after(elm);
            }

        }, // edit options
        {height:320, width:500, reloadAfterSubmit:true, addCaption: gridName + ” hinzufuegen”}, // add options
        {reloadAfterSubmit:false}, // del options
        {} // search options
    );

Generated code looks like this:

<tr id=”tr_Telefon class=”FormData rowpos=”8>

</tr>
<tr id=”tr_Fax class=”FormData rowpos=”9>
</tr>
<tr id=”tr_Email class=”FormData rowpos=”10>
</tr>
<tr id=”tr_inaktiv class=”FormData rowpos=”11>
</tr>
<tr class=”FormData style=”display: none;>
<td class=”CaptionTD/>
<td class=”DataTD colspan=”1>
</td>
</tr>
</tbody>
09/10/2009
04:06
Avatar
tony
Sofia, Bulgaria
Moderator
Members

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

Hello,

What I do in my apps is quite easy, but requiere to use in the readers - repeatitems:false.

In this case you can define the second password in colModel and show or hide it depending on the conditions.

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.

09/10/2009
13:33
Avatar
patrick
Guest
Guests

thx, will try it.

Forum Timezone: Europe/Sofia

Most Users Ever Online: 715

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