My edit form requires a dropdown to be populated by a database call. I realize I must set the dataurl parm in the colModel. Does anyone have an example using a linq to sql call which returns the data in the format the jqgrid is looking for. Thanks.
You may want to look into jqGrid for ASP.NET.
Related
I have a jqgrid table in which I display my data,locally.
I need to add record,edit record and delete.I referred to Multiple jqGrid on one page, how to identify which grid on when click on "add" button on navigator? for jqgrid 4.5.4 version.
The add record doesn't work for me on jqgrid 4.6.0 version.It adds record succesfully only the first time.On subsequent attempts,The issue I am facing is,
onClickSubmit has postdata row values empty.So as result,it adds blank rows.
The code I use is exactly same as mentioned in the link above.The only change is my JSON data is :
data = [{'fname':'abc','lname':'def'},
{'fname':'efg','lname':'xyz'}]
Also,colNames and colModel looks like :
colNames:['fname','lname'],
colModel:[{'name:'fname', index:'fname', width:'40',editable: true,key:true},
{name:'lname', index:'lname', width:'60', sortable:false,editable: true}]
OnClickSubmit shows postdata with empty values for rows i.e. postdata.fname :' ',postdata.lname:' ',though I have added values in add record pop-up.Also,the add record dialog shows values in the text filled with previous values ,that were used when adding the record first time.Please help as I am really stuck up on this issue now!
Thanks,
Shweta
This issue was addressed in the jqGrid forum:
"The form edition[] does not support local editing. You can use inline edit for this purpose. See editurl option on how to point to local editing."
For inline editing, refer to jqGrid documentation.
I am using Jquery data table plugin. I was able to display it properly with filtering, sorting and Paging.
But, now the problem is i need to filter the data table rows based on dropdown selection made.
but, i do not have any idea how to do this..I am very new to MVC. So, here i need to send that dropdown selected item as parameter to a server side method and call a method and rebind data to the data table.
I am initially binding data to the data table using for loop and iterating over a datatable
Do i need to use Ajax here..if so how to get the new datatable/data to this view and bind to data table?
Please suggest the way to do..
you use the jquery datatable for this
create function and paste jquery datatable code in there
then call this function on dropdown selection change using jquery.
Tips :jquery datatable code available on net find and use it
I need to generate a table in MVC that can have a variable set of horizontal columns (years). I need to render a textbox in each cell and I need to postback the values to a action method. I have seen examples where the editable cells are generated but the columns are fixed (using partials). I have also seen examples where the table can be rendered with dynamic columns but without the editable cells/textboxes. Can anyone suggest an approach?
I would recommend creating the dynamic table with a textbox in each cell with an onchange action to send the data via ajax to the controller for the update.
You will probably need to pass a multidimensional array within the model and use it to create and load your table.
The question is though how are you expecting to handle this on the server side?
If you name them all sequentially and know the # of columns ahead of time the model binder CAN bind to a list for you if they are all named in the appropriate format. Do you want to generate the list from a model or some other method?
Phil Haack covers how the naming format is, although the EditorFor will handle this automatically in some cases. If it doesnt work in yours, simply naming them in this scheme should work.
http://haacked.com/archive/2008/10/23/model-binding-to-a-list.aspx
I just found that sample
http://www.ok-soft-gmbh.com/jqGrid/DataToMultiSelect2.htm
I want to have something similar:
I want to be able to post selected values on server and also i want to have a dropdown and based on that dropdown selection another cell value of that row gettign changed
How can i do that?
|Id|Dropdown|ValueChangedOnDropdownChanged|
1 A[A/B] A selected
2 B[A/B] B selected
*[A/B] it is dropdown options
I am not sure that I understand your question correct. The demo which you reference in your question I created before for the answer and this one.
Look at the another old demo. It shows how to implement dependent select (dropdown) list. The demo shows how to it in inline editing, form editing and the searching toolbar. In case of the usage of server base data you will have to use dataUrl and buildSelect to implementation of the same behavior. The dataUrl should be used instead of the v property of the searchoptions or editoptions. The buildSelect can be used ton only to modify the server response, but just as the good place to rebuild the dependent select (dropdown list).
I'm using a jqGrid, and it gets populated fine. From the UI perspective, one of the columns in the jqGrid is editable. How can I make one of the columns as editable (say like a text box)?
The reason is, in my case when the grid successfully loads, the UI is going to show one of the column's values as editable.
If you're looking to edit the column values directly in the grid, similarly to how you might in Excel, look into the inline editing API:
http://www.trirand.com/jqgridwiki/doku.php?id=wiki:inline_editing&s[]=inline
In colmodel, you have to specify editable: true.Provide edit action link in editURL:... option of jqgrid.
you have to get the "id" of that column and then remove 'disabled' attribute on that.
for example -
$('#idofthatcolumn').removeAttr('disabled');
OR
$('#idofthatcolumn').removeAttr('readonly');
In your colmodel you should specify editable as true i.e, editable:true and specify the editUrl:'localhost:8080/yourApp'
Also if you want to store it in the client side, then specify it as editUrl:'clientArray'