PDA

View Full Version : [FIXED] [V0.8.0] Sorting numbers with ext:TableGrid



NestorLeone
Jan 19, 2009, 12:04 PM
Here's something that has more to do with HTML than purely coolite, but perhaps someone can through a light on the matter.

When I make simple html table and add the <ext:TableGrid> to enclose it, the columns that are populated with just numbers, are always aligned to the left - ignoring the Align="right" tag in the <TD> - and bringing along the problem to sort these columns, as it sorts them just as text, making "111" to go first than "22", just because sorts from left to right. Not as numbers but as strings.

I tried to left pad spaces to the numbers, but even thought they are rendered, the text keeps aligning always to the left.

any clues?

geoffrey.mcgill
Jan 19, 2009, 5:37 PM
Hi Nestor,

I'm looking into this. I think we should be able to get this working.

NestorLeone
Jan 20, 2009, 11:34 AM
Great. Thanks! I'll keep checking this discussion.

Vladimir
Jan 26, 2009, 3:42 PM
Hi,

We fixed it. Now the TableGrid has Fields and Columns property when you can specified type and other params.


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

<%@ Register Assembly="Coolite.Ext.Web" Namespace="Coolite.Ext.Web" TagPrefix="ext" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
<title>Converting table into GridPanel - Coolite Toolkit Example</title>
<link href="../../../../resources/css/examples.css" rel="stylesheet" type="text/css" />

<style type="text/css">
#data { width:400px; border:1px solid #bbb; border-collapse:collapse; }
#data td, #data th { border:1px solid #ccc; border-collapse:collapse; padding:5px; }
</style>
</head>
<body>
<ext:ScriptManager ID="ScriptManager1" runat="server" />

<h1>Convert an existing HTML &amp;lt;table> into a simple GridPanel</h1>

<ext:TableGrid runat="server" Table="data" StripeRows="true">
<Fields>
<ext:RecordField Type="String"></ext:RecordField>
<ext:RecordField Type="Int"></ext:RecordField>
<ext:RecordField Type="String"></ext:RecordField>
</Fields>
<Columns>
<ext:Column Header="NameC"></ext:Column>
<ext:Column Align="Right"></ext:Column>
<ext:Column></ext:Column>
</Columns>
</ext:TableGrid>

<table style="visibility:hidden;" id="data">
<thead>
<tr>
<th>Name</th>
<th>Age</th>
<th>Gender</th>
</tr>
</thead>
<tbody>
<tr>
<td>Barney Rubble</td>
<td>32</td>
<td>Male</td>
</tr>
<tr>
<td>Fred Flintstone</td>
<td>33</td>
<td>Male</td>
</tr>
<tr>
<td>Betty Rubble</td>
<td>32</td>
<td>Female</td>
</tr>
<tr>
<td>Pebbles</td>
<td>111</td>
<td>Female</td>
</tr>
<tr>
<td>Bamm Bamm</td>
<td>2</td>
<td>Male</td>
</tr>
</tbody>
</table>
</body>
</html>

NestorLeone
Jan 26, 2009, 3:56 PM
Is that available in 0.7 ? I supose not, so..... how do I get 0.8.0 ?

Thanks!!!!

NestorLeone
Feb 03, 2009, 12:49 PM
Any news Vladimir??