Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Why this code is not executing?
Message
De
02/11/2012 17:43:58
 
 
Information générale
Forum:
ASP.NET
Catégorie:
MVC
Versions des environnements
Environment:
C# 4.0
OS:
Windows 7
Network:
Windows 2003 Server
Database:
MS SQL Server
Divers
Thread ID:
01555962
Message ID:
01556341
Vues:
48
Is this a parent/detail form and you want to grab one detail row? If so, it should be created as a javascript array. It would help to see the code from the view.

>document.location works nice, but what I really want is to be able to grab the row data, but open the form the same way it was opened before (e.g. in modal window).
>
>Here is what I currently have:
>
>function edit(com, grid)
>{
>        $('.trSelected', grid).each(function () {
>
>          
>                var id = $(this).attr('id');
>                id = id.substring(id.lastIndexOf('row') + 3);
>
>                document.location = '/Client/Edit/' + id;            
>
>            $("#sform").dialog({
>                autoOpen: false,
>                show: "blind",
>                width: 1000,
>                height: 600
>            });
>            $("#sform").dialog("open");
>            clearForm();
>            $('#fntype').val('Edit');
>            $('#Id').val($('.trSelected td:eq(0)').text());
>            $('#Number').val($('.trSelected td:eq(1)').text());
>            $('#Name').val($('.trSelected td:eq(2)').text());
>
>            $('#Contact1').val($('.trSelected td:eq(3)').text());
>
>        });
>
>    }
>
>
>I can not figure out certain things:
>
>1. I need to get the row data from the server, but then continue with the rest of the code (e.g. show the info in that modal form)
>
>2. How to make double click work
>
>3. Why my validations no longer fire after I re-factored the class. I want to use complex types, but with the complex types I get
>
>
><div class="editor-label">
>    <label for="Email">Email</label>
></div>
><div class="editor-field">
>    <input class="text-box single-line" data-bind="value: Email" data-val="true" 
>data-val-email="The Email field is not a valid e-mail address." 
>data-val-length="The field Email must be a string with a maximum length of 100." data-val-length-max="100"
> id="Email" name="Contact1.Email" type="text" value="" />
>    <span class="field-validation-valid" data-valmsg-for="Email" data-valmsg-replace="true"></span>
></div>
>
>So, the id is "Email" and the name is "Contact1.Email"
>
>I have two controls with the same Id in the form and this is why I think validations are getting confused. However, I don't know what to do to fix the problem?
>
>
>
Craig Berntson
MCSD, Microsoft .Net MVP, Grape City Community Influencer
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform