Click here to Skip to main content
15,893,190 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
XML
<% Html.Grid(Model.InnerModel.ParamaterDetails)
            .Empty("No data available")
            .Columns(column =>
            {
                column.For(x => x.MinValue).Named("Possible Min Value");
                column.For(x => x.MaxValue).Named("Possible Max Value");
                column.For(x => x.ScoreValue).Named("Bespoke Score Value");
                column.For(x => "<input type='button' name='button' class='btn' id='editOpenDialog' value='Edit' onclick=javascript:editParametersDialog('" + x.ID + "'); />").DoNotEncode();
            }).Render(); %>


<%Html.EndForm(); %>
<script type="text/javascript">
    function editParametersDialog(ID) {
        // Go back to the server and get the data for the road card timetable
        $.ajax({
            url: "GetDetails",
            type: "POST",
            data: "ID=" + ID,
            dataType: "json",
            success: function(data) {
                UpdateEditDialog(data);
                $('#addEditDialog').dialog('open');
            },
            error: function(jqXHR, textStatus, errorThrow) { alert(jqXHR); alert(textStatus); }
        });
    }

    function UpdateEditDialog(data) {
        $("#MinValue").val(data.MinValue);
        $("#MaxValue").val(data.MaxValue);
        $("#ScoreValue").val(data.ScoreValue);
    }

    $(document).ready(function() {
    });

</script>

GetDetails above is in controller
 [AcceptVerbs(HttpVerbs.Post)]
        public JsonResult GetDetails (int ID)
        {
// some code here
}



The onclick call javascript:editParametersDialog does not work. It does not get evoked. Any clues what I might be doing wrong.

I can figure out that javascript:editParametersDialog does not turn BLUE which is normally the case.
Posted
Comments
walterhevedeich 10-Aug-11 6:29am    
Have you tried debugging it using FireFox? It seems that it will work.
ShonaR 10-Aug-11 10:52am    
The code is working checked with Firefox debugging, but it does not open the dialog, gives an error on that "Object does not support this property or method"

Any ideas why it may be giving that error

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900