1

I have a request from the client to have a drop down and a text field for mobile number column in jqgrid add / edit form.

Like this

Mobile number <countrycode drop down> <mobile number text field>

I want to know can this be done in jqgrid add/edit form? If yes, then how?

@UPDATE: Here is how i want the output in add / edit form (you will need to create a html file with below code and see the output in browser). Sorry can't upload image, do not have that many reputations :(...

<html>
<body>
<table>
  <tr>
<td>Phone#</td>
<td>:</td>
<td> 
        <select><option value=1>1</option></select>  
        <input type="text"/>
    </td>
  </tr>
</table>
</body>
</html>
Natraj
  • 397
  • 4
  • 9
  • 35

2 Answers2

0

Although it has been 5 years, but no one answer, I having the same problem, and I has been find out solution. It easy but I has a lot of time to do it. Just like this:

In ColModel set formoptions: { rowpos: x, colpos: y }:

colModel: [
            { name: "CategId", index: "CategId", label: arrTool.CategId, width: 100, editable: true, formoptions: { rowpos: 1, colpos: 1 } },
            { name: "Category", index: "Category", label: arrTool.Category, width: 100, editable: true, formoptions: { rowpos: 1, colpos: 2 } }
]

Result: enter image description here

Hong Van Vit
  • 2,884
  • 3
  • 18
  • 43
  • Additionally to this in case you use Guriddo jqGrid you can implement a what you want form using templates as shown in [this article](http://guriddo.net/?kbe_knowledgebase=using-templates-in-form-editing) – Tony Tomov Oct 28 '17 at 06:31
0

This is certainly possible using jqgrid. I think you'll find this question relevant to what you're trying to accomplish. Particularly of interest will be the way that the edittype within the colModel is set up for the field you're interested in making a select. The text input will be the default format of the field in the edit modal.

All that being said, I'm assuming you're not using the paid version of jqGrid, which in the case that you are, you'll need to set your edit options a little differently. You can read a little more about doing it in the paid version here.

Community
  • 1
  • 1
jeremy.ary
  • 81
  • 1
  • 1
  • 7
  • Thanks for your reply. But that's not what I want. What I want is when a add / edit form is displayed the mobile number field should show two edit fields one a country and another a text box. – Natraj Dec 07 '11 at 05:22