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
Setting Caption for Edit Grid
29/08/2009
11:41
Avatar
Martin
Guest
Guests

I have a Grid I'm using Form Edit, and trying to set the caption to something other than  the default 'Edit Record'.  So, using beforeShowForm, and the “Form ID is passed” theory I thought the format should be:

 beforeShowForm:function setTitle(formID) {
                alert(”beforeShowData”);
                formID.editGridRow(”rowID”,{setCaption:”foo”});
            },

What should I be using to set the Caption (Or topinfo – that would be fine too).

Thanks

Martin

30/08/2009
11:13
Avatar
MamaliFrenchi
Member
Members
Forum Posts: 62
Member Since:
22/12/2008
sp_UserOfflineSmall Offline

How about  editCaption: 'My Captioni'

30/08/2009
15:05
Avatar
Martin
Guest
Guests

Thanks but that didn't work either.  I suspect I'm not addressing the correct grid.  I want to change the title of the Grid that pops up when selecting "Edit" in the Form Edit code.

30/08/2009
15:14
Avatar
MamaliFrenchi
Member
Members
Forum Posts: 62
Member Since:
22/12/2008
sp_UserOfflineSmall Offline

Where did you add the editCaption? if you're using navgrid('#pager',{ edit:true, etc},{editCaption:'New Caption, other properties of edit form},{}//etc should work

30/08/2009
18:46
Avatar
Martin
Guest
Guests

I'm trying to set it in the before show form of the edit action.

When the user selects a row of the grid to edt, I want to set either the caption or the top info to the value of a col in the selected row.  Hence the Caption of the edit-form needs to change depending on the selected row.

The documentation says that the edit form ID is passed to the BeforeShow Form, and that the topinfo is passed into the function, and the various attributes are passed as parameters but I can't figure out how to set them.

Thx

Martin

30/08/2009
20:43
Avatar
MamaliFrenchi
Member
Members
Forum Posts: 62
Member Since:
22/12/2008
sp_UserOfflineSmall Offline

if I understant you correctly you are calling editGridRow(id,{}); in this case you can add it as following:

editGridRow(id,{editCaption: 'Edit caption', afterShowForm: function(){}, etc});

30/08/2009
22:52
Avatar
Martin
Guest
Guests

Hi,

Thanks for the help.  Maybe I should start at the beginning...

I have a grid, #list1, that I wish to edit using the Form Editing functions on a selected row.

I think I can set the property "topinfo" of the modal edit form using the beforeShowForm event.  I can't find any documentation *how* to set the topinfo property on the Edit Grid.

 beforeShowForm:function setTitle(formID) {
                alert(”beforeShowData”);
                formID.editGridRow(”rowID”,{topinfo:”foo”});
            },

Isn't working, so I'd really like to see an example of a working function that sets the topinfo of a modal edit (or add!) gridform. I'd don't know if 1) this is the right way to address the new edit form grid, 2) If editgridrow is the right methid to change the property "topinfo"

Thanks

Martin

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

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

Hello,

You call editGridRow twice which IMHO is not good.

In order to change the edit caption dynamically do this:

beforeShowForm : function (formid) {

var mytitle = "My text to show"; // or what you want

$(".ui-jqdialog-title","#edithd"+mygridid).html(mytytle);

}

wher mygrid id is the id of the grid.

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.

31/08/2009
15:20
Avatar
Martin
Guest
Guests

Ahhhh, ok now I understand....(I think).  So there's no need to use the formid as passed in?.  Looks good, thanks again.

Martin

Forum Timezone: Europe/Sofia

Most Users Ever Online: 715

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