I used cellsubmit: 'remote' to force an ajax call.
What does 'clientArray' do and for what is it used for?
Also, how can I add post data to the remote ajax request on save, I tried the following and it did not work:
Hi Tony, this may be more of a jQuery question but I am returing an un-numbered list from the server of all errors (see below) but for some reason although it renders my html tags perfectly it does not display it in html format:
JSON formatted ERRORS looks like:
code:
afterSubmit: function(response, postdata) {
var errors = eval('('+ response.responseText +')').Errors.Errors;
if (errors) {
Hi Tony, I had to laugh when I realized what had happened. I specified the “afterSubmit()” event as a event directly on the jqGrid instead of specifying it as part of the events for “navGrid()”. It now works as you had excplained. Sorry for the confusion, my bad. Thank you for taking the time to help me.
That looks good Tony, you are right I can do it outside of jqGrid but am hoping you folks would include a more “built-in” property and message area for the modal dialog for edits and inserts.
The big problem with this approach on modal dialog's edit/add record is that the “loadComplete” event only fires on initial load and not after every “submit” from the edit/add modal dialog box's ajax call, so which event fires after each one of these events? For example in the Live Data Manipulation NAVIGATOR example, when you click on “Edit selected row”, when the server returns data via userdata and I get it via getUserData(), on what event do I need to attach it, as loadComplete doesn't fire after the ajax call?
Tony by the way, you are right (as always) the userdata is so much easier to set up and get via getUserData(), thanks for the help.
Tony, I am in the middel of my project and just need a basic idea of when you think the new release with the custom message for search (and edit/add modal dialog) will be done so I will know if it is going to come in time?
Hi Tony thanks for the speedy reply. I cannot use aftersubmit as I am using the modal dialog that performs an ajax call and not a form submit, unless I do not understand what events fire with the modal dialog but as far as I understand the modal dialog, not the inkline edit, only performs an ajax call and the aftersubmit will not fire, is that the correct assumption?
What I meant in my original post is that I have included an error message as part of my JSON return string from the server. I want to parse out the error from the JSON string (as you currently do for pages, rows, etc) and display it inside the modal dialog of the formedit. The return string looks like this after I click “submit” on the “Edit Record” modal dialog:
|
1 |
{"CurrentPage":1,"TotalPages":0,"TotalRecords":0,<br /><span style="color: #3366ff">“Message”:”\</span><span style="color: #3366ff">The postal code is invalid”,”Addresses”</span> |
|
1 |
<span style="color: #3366ff">:null</span>} |
|
1 |
<br />So inside the formedit modal dialog I want to be able tio display this <br />message.<br /> |
Shimon, right on! Thanks for gettnig back to us.
Shimon I had a similar issue, however and I am not sure if this solves your problem, if the membership number is embedded in the HTML somewhere can you not just get it via a jQuery selector?
/Membership/Delete?memNo='+$(currentRow '+ input#memNo').val()
meaning currentRow could be set up to look for the current row's key (of course if button on each row other wise if check box with delete button at bottom of page will change selector slightly):
currentRow = $(this).parent().parent (as button in td in tr)
Let me know if this helps.
Thank you Tony! I would like to enable client side validation if only it for adding our own validation functions as in my example above. I would hate for request to travel all the way to the server just to find out the request was invalid in the first place
Can you extend the sval to inherit the same editrules options and trigger the same event for validation as on editting a row?
Again thank you for a great control!
I know this does not work (see below) but why is it not working?
Good question. Mvc will support any path you thorw at it as long as it's pattern is mapped in the route dictionary. For example in my case I have such a big Mvc app I decided to create sub-folders for my controllers. Remember, the Mvc routingengine abstracts the folder structure you have so you don't have to reveal your folder structure in your url. I have an Account folder with an AccountController, AccountSummaryController, etc. So my url would look like /Account/Account/GetMyDataById/101, but it doesn't, it only shows /Account/GetMyDataById/101.
If you do not specifcy the “/” in front of the Account in your url in your ajax call, the routing engine will prefix your url with the current url, so you will get something like /Account/GetMyDataById/Account/GetMyDataById/101. So make sure you prefix url with an “/” and include the controller: “/Account/GetMyDataById“.
Just as an example my route map looks like this:
routes.MapRoute(“Account”, “Account/{action}/{accountId}”,
If you want to add hiding and displaying of the message based on content you can also do in grid.base.js:
Left out an important piece in grid.base:
Copyright 2014 TriRand LtdAll Rights ReservedRSS
Back to Top