evento jqgrid AfterShowForm

I have a jqGrid with a function "MyFunction" in AfterShowForm event.

MyFunction= function() {
 $("#MyElementId").attr("disabled", "true");

The code above works, but if I remove the alert does not work!!

¿Por qué?


El código HTML es:

<div id="editcntgridVisualizzazioni" class="ui-jqdialog-content ui-widget-content">
        <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">
                    <tr id="FormError" style="display:none">
                        <td class="ui-state-error" colspan="2"></td>
                    <tr style="display:none" class="tinfo">
                        <td class="topinfo" colspan="2"></td>
                    <tr id="tr_AggregazioniDatiDesc" class="FormData" rowpos="1">
                        <td class="CaptionTD">Agrégation</td>
                        <td class="DataTD">&nbsp;
                            <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>

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"...

preguntado el 24 de agosto de 12 a las 08:08

what is MyElementId here..paste the respective html -

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()); -

@PiyushSardana: I update my answer with HTML code -

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. -

@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 -

0 Respuestas

No es la respuesta que estás buscando? Examinar otras preguntas etiquetadas or haz tu propia pregunta.