Hmmm...  Well, it's valid JSON (http://www.jsonlint.com/), and valid
Javascript.  I removed "<
%=Html.BuildUrlFromExpression<ProjectController>(c =>
c.UserList(ViewData.Model.ID))%>" from the code (but left the
surrounding 'quotes'), and ran it through JSlint (http://
www.jslint.com/) and it only complained about $ being an implied
global. So that's okay.

Can we see the rendered Javascript to double check that?

I would suggest installing Firebug ( http://www.getfirebug.com ) if
you haven't already.  It may allow you to explore the error a bit
more.  Firebug will also let you use 'console.log()', which is
incredibly powerful.  http://getfirebug.com/console.html

Do something like:
   var my_url = '<%=Ht..............l.ID))%>';
   console.log(my_url);
   $("#flex1").flexigrid(
                        {
                        url: my_url,
                        dataType: 'json', ...


Is there a live page I could investigate?



On Sep 25, 4:44 pm, Jack <[EMAIL PROTECTED]> wrote:
> I'm using FlexiGrid with JQuery 1.2.6 and ASP.NET MVC Preview 3. I
> seem to be able to get JSON data out of the controller properly, but
> the data won't render in the FelxiGrid.
>
> Here is the data from the controller action:
> [{"ID":{"Length":
> 36},"UserName":"joe_user_TRPP","FirstName":"","LastName":"","Address":"","City":"","State"
> :"","Zip":"","FullName":" "},{"ID":{"Length":
> 36},"UserName":"asdf","FirstName":"asdf","LastName":"asdf"
> ,"Address":"","City":"","State":"WA","Zip":"","FullName":"asdf asdf"}]
>
> My client side script is:
>
> <script type="text/javascript">
> $(document).ready(function(){
>
>                         $("#flex1").flexigrid
>                         (
>                         {
>                         url: '<
> %=Html.BuildUrlFromExpression<ProjectController>(c =>
> c.UserList(ViewData.Model.ID))%>',
>                         dataType: 'json',
>                         colModel : [
>                                 {display: 'UserName', name :
> 'UserName', width : 180, sortable :
> true, align: 'left'},
>                                 {display: 'Address', name : 'Address',
> width : 180, sortable :
> true, align: 'left'}
>                                 ],
>                         searchitems : [
>                                 {display: 'UserName', name :
> 'UserName', isdefault: true}
>                                 ],
>                         sortname: "UserName",
>                         sortorder: "asc",
>                         usepager: true,
>                         title: 'Users',
>                         useRp: true,
>                         rp: 15,
>                         showTableToggleBtn: true,
>                         width: 700,
>                         height: 200
>                         }
>                         );
>                         });
> </script>
>
> Besides no data being rendered I get an "object is undefined" on like
> 725 of jquery-1.2.6" and the grid displays the message "Displaying NaN
> to NaN of undefined items". I've tweaked the Data Transfer object to
> both exclude and includes various items, but it still doesn't seem to
> work.
>
> I've also tried jquery-1.2.3 and get similar problems, but on a
> different line.
>
> Any clues to what the problem is?
>
> Thanks
> Jack

Reply via email to