PDA

View Full Version : Problem with Grids



PascuV
Sep 13, 2018, 8:53 AM
Hi,

Im trying to create a grid for my application and its not being possible.

I Have copied your example (http://mobile.ext.net/#demo/basicgrid) about a basic grid and is still not working. Here is what i've tried:


<%@ Page Language="C#" %>


<!DOCTYPE html>

<script runat="server">
public static List<object> Data = new List<object>
{
new
{
name = "Lisa",
email = "lisa@simpsons.com",
phone = "555-111-1224"
},

new
{
name = "Bart",
email = "bart@simpsons.com",
phone = "555-222-1234"
},

new
{
name = "Homer",
email = "homer@simpsons.com",
phone = "555-222-1244"
},

new
{
name = "Marge",
email = "marge@simpsons.com",
phone = "555-222-1254"
}
};
</script>

<html>
<head runat="server">
<title>Ext.NET Mobile Example</title>

</head>
<body>
<ext:ResourceManager runat="server" Theme="Triton" />

<ext:Grid runat="server" Title="Simpsons">
<Store>
<ext:Store runat="server" DataSource="<%# Data %>" AutoDataBind="true">
<Fields>
<ext:ModelField Name="name" />
<ext:ModelField Name="email" />
<ext:ModelField Name="phone" />
</Fields>
</ext:Store>
</Store>
<Columns>
<ext:Column runat="server" Text="Name" DataIndex="name" Width="100" />
<ext:Column runat="server" Text="Email" DataIndex="email" Width="210" />
<ext:Column runat="server" Text="Phone" DataIndex="phone" Width="150" />
</Columns>
</ext:Grid>
</body>
</html>

This shows the Grid, but it shows it empty, theres no data on it.


And another question (I dont know if I should open a new thread for it):

Is it possible to make something like "command column" to select a row like we can do in Ext.Net? I would like to do something like MultiSelectionGrid (http://mobile.ext.net/#demo/multiselectiongrid) to select one or various rows, but I would like to select and insert them into a List, not to delete them.

PascuV
Sep 17, 2018, 10:10 AM
Hello? Any help?

fabricio.murta
Sep 17, 2018, 2:06 PM
Hello @PascuV! Thank you very much for bumping the thread, and sorry for taking so long to reply. We are going to review your inquiry right away and post you a feedback, just wanted to post this feedback to let you know we are looking at your inquiry now.

fabricio.murta
Sep 17, 2018, 2:31 PM
Hello again, @PascuV!

The issue is actually a limitation from Ext.NET Mobile that's easily addressable by setting up a viewport to the page.

Preferably, you should use a ViewPort block and enclose everything that's on the page within it. Alternatively, say, if you just want to show that grid on the page and set up everything else within the grid (maybe close or back buttons, etc), you can just add the Fullscreen="true" setting to the grid definition.

Notice the Fullscreen setting is a shorthand for wrapping the viewport around the component, and should only be used in one -- the outermost, if there are more than one -- component of the page.

Here's how the same code you provided should look like when you wrap a viewport around it:



<%@ Page Language="C#" %>

<!DOCTYPE html>

<html>
<head runat="server">
<title></title>

<script runat="server">
public static List<object> Data = new List<object>
{
new
{
name = "Lisa",
email = "lisa@simpsons.com",
phone = "555-111-1224"
},

new
{
name = "Bart",
email = "bart@simpsons.com",
phone = "555-222-1234"
},

new
{
name = "Homer",
email = "homer@simpsons.com",
phone = "555-222-1244"
},

new
{
name = "Marge",
email = "marge@simpsons.com",
phone = "555-222-1254"
}
};
</script>
</head>
<body>
<form id="form1" runat="server">
<div>
<ext:ResourceManager runat="server" />
<ext:Viewport runat="server">
<Items>
<ext:Grid runat="server" Title="Simpsons">
<Store>
<ext:Store runat="server" DataSource="<%# Data %>" AutoDataBind="true" Width="500">
<Fields>
<ext:ModelField Name="name" />
<ext:ModelField Name="email" />
<ext:ModelField Name="phone" />
</Fields>
</ext:Store>
</Store>
<Columns>
<ext:Column runat="server" Text="Name" DataIndex="name" Width="100" />
<ext:Column runat="server" Text="Email" DataIndex="email" Width="210" />
<ext:Column runat="server" Text="Phone" DataIndex="phone" Width="150" />
</Columns>
</ext:Grid>
</Items>
</ext:Viewport>
</div>
</form>
</body>
</html>


Sorry again for missing your thread, and hope the answer above fully solves your problem with Ext.NET mobile. If not, please let us know!

fabricio.murta
Jan 24, 2020, 6:17 PM
Hello @PascuV!

It's been a long long time since we posted an answer here, and still no feedback from you. Did the information above help you with the issue, or do you still need help?

We may mark this thread as closed in 7+ days counting from today, given you don't need help here or don't post a follow-up in the meanwhile. It won't prevent you from posting later though, as we don't lock-up the thread, and the discussion can be resumed from where it stopped.