about add a record in master

Questionsabout add a record in master
Chao Shun Jenq asked 11 years ago

Hello,

i added a record in master grid,

Q1:may i set the focus on lastest added record?

Q2:the detail grid will be reflash automatically?

Rgds,

6 Answers
Abu Ghufran answered 10 years ago

#1, Focus on latest record is not supported now. You can try searching on google, for "jqgrid focus latest record". I can incorporate if it is supported by core lib.

#2, You can try setting

$opt["add_options"]["afterSubmit"] = "function(response) { if(response.status == 200) $("#list2").trigger("reloadGrid", [{current:true}]); }";

where list2 is detail grid id.

Chao Shun Jenq answered 10 years ago

Hi,
thank you for your help!

in add dialog , i can set the button event as
$opt["add_options"]["afterSubmit"]
in edit dialog , i can set the button event as
$opt["edit_options"]["afterSubmit"]
can you tell me how to set the delete dialog after submit?
is $opt["delete_options"]["afterSubmit"] ?
(but delete dialog has "delete button" not "submit button" )

rgds,

Chao Shun Jenq answered 10 years ago

–continue—
if i set
$opt["delete_options"]["afterSubmit"] = "function() { $('#list2').trigger('reloadGrid', [{current:true}]);}";

when i click the "delete" button in delete dialog ,
the list2 grid will be reload.
but delete dialog can not be close automatically.

how to close delete dialog automatically ?

Rgds,

Abu Ghufran answered 10 years ago

Add return true line at end.
return [true,""];

like …
$opt["delete_options"]["afterSubmit"] = "function() { $('#list2').trigger('reloadGrid', [{current:true}]); return [true,""]; }";

Ivan answered 9 years ago

Hi to all ,
this code :
$opt["delete_options"]["afterSubmit"] = "function() { alert('ciao'); return [true,'']; }";
not work with inline delete in the column Action , thanks in advance

Abu Ghufran answered 9 years ago

The afterSubmit only works with dialog.
You can connect on_delete event handler and perform validation there.

refer demos/editing/servre-validation.php (exist in licensed ver)

Your Answer

4 + 13 =

Login with your Social Id:

OR, enter

Attach code here and paste link in question.
Attach screenshot here and paste link in question.



How useful was this discussion?

Click on a star to rate it!

Average rating 0 / 5. Vote count: 0

No votes so far! Be the first to rate it.

We are sorry that this post was not useful for you!

Let us improve this post!

Tell us how we can improve this post?