evento jqgrid AfterShowForm
Frecuentes
Visto 1,452 veces
1
I have a jqGrid with a function "MyFunction" in AfterShowForm event.
MyFunction= function() {
alert("#MyElementId");
$("#MyElementId").attr("disabled", "true");
}
The code above works, but if I remove the alert does not work!!
¿Por qué?
Editar
El código HTML es:
<div id="editcntgridVisualizzazioni" class="ui-jqdialog-content ui-widget-content">
<span>
<form name="FormPost" id="FrmGrid_gridVisualizzazioni" class="FormGrid" onsubmit="return false;" style="width:100%;overflow:auto;position:relative;height:auto;">
<table id="TblGrid_gridVisualizzazioni" class="EditTable" border="0" cellpadding="0" cellspacing="0">
<tbody>
<tr id="FormError" style="display:none">
<td class="ui-state-error" colspan="2"></td>
</tr>
<tr style="display:none" class="tinfo">
<td class="topinfo" colspan="2"></td>
</tr>
<tr id="tr_AggregazioniDatiDesc" class="FormData" rowpos="1">
<td class="CaptionTD">Agrégation</td>
<td class="DataTD">
<select disabled="disabled" name="AggregazioniDatiDesc" id="AggregazioniDatiDesc" maxlength="128" class="FormElement" role="select">
<option role="option" value=""></option>
<option role="option" value="1">Aucune</option>
....
</select>
</td>
</tr>
....
where "AggregazioniDatiDesc" is MyElementId
The above code is created from jqgrid in the editing form...
If I don't put the alert, the element doesn't have attribute disabled="disabled"...
0 Respuestas
No es la respuesta que estás buscando? Examinar otras preguntas etiquetadas jquery jqgrid form-editing or haz tu propia pregunta.
what is MyElementId here..paste the respective html - Piyush Sardana
The strange is that the 1° alert show "undefined" and the 3° show the correct value alert($("#AggregazioniDatiDesc").val()); alert("bla bla bla"); alert($("#AggregazioniDatiDesc").val()); - sara
@PiyushSardana: I update my answer with HTML code - sara
seems very freaky problem, i dont know when you are calling this function. You can try with this $("#MyElementId").attr("disabled", "disabled");, If it doesn't work, let me have a look at your code, you can share your screen with me through skype. my skype is piyush.sardana7 I will be available after 8 hours from now. - Piyush Sardana
@PiyushSardana: thanks very much. But I solve change select with text. In my model I put this dataAnnotation: [JqGridColumnEditable(true,..., ..., EditType = JqGridColumnEditTypes.Text)] and so it work without alert - sara