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

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?

Jan 19, 2009, 5:37 PM
Hi Nestor,

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

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

Jan 26, 2009, 3:42 PM

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"

<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; }
<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">
<ext:RecordField Type="String"></ext:RecordField>
<ext:RecordField Type="Int"></ext:RecordField>
<ext:RecordField Type="String"></ext:RecordField>
<ext:Column Header="NameC"></ext:Column>
<ext:Column Align="Right"></ext:Column>

<table style="visibility:hidden;" id="data">
<td>Barney Rubble</td>
<td>Fred Flintstone</td>
<td>Betty Rubble</td>
<td>Bamm Bamm</td>

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


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