Form only view

QuestionsForm only view
Ali asked 11 years ago

Hello there,

Is it possible to have the edit form show by default and not the grid first? Or have one section of my page for only the grid, and another section for the form?

1 Answers
Abu Ghufran answered 11 years ago

Hello,

Currently it is not doable. How ever you can use external form and post data to grid using ajax.
Pasting from faqs.

Q) How to post data using JS code?

Assuming, you are posting to grid with id (list1), here is the sample JS code.
"id" is PK (_empty), "oper" will be "add" for new record. Rest are the table fields in myData.

<script>
auto_add = function ()
{
myData = {};
myData.id = "_empty";
myData.oper = 'add';
myData.invdate = '2013-06-12';
myData.note = 'test2';
myData.total = '22';
myData.client_id = '10';
jQuery.ajax({
url: "?grid_id=list1",
dataType: "json",
data: myData,
type: "POST",
error: function(res, status) {
alert(res.status+" : "+res.statusText+". Status: "+status);
},
success: function( data ) {
}
});
jQuery("#list1").jqGrid().trigger('reloadGrid',[{page:1}]);
}
</script>

<button onclick="auto_add()">Add</button>

Your Answer

14 + 8 =

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?