Hi all,
can anyone pl say how to sort the particular column in dojo grids by default...
For example..
If i'm having columns like...
col1,col2,col3,col4,col5 in the grid..
"col3" should be displayed in descending order by default..
please help me out...
Thanks in Advance...
6 10129
I would suggest you check the documentation. Something like this may help.
I would suggest you check the documentation. Something like this may help.
Thank u Acoder....
I have tried the following code.... -
-
-
<%@ include file="JspBean.jsp" %>
-
<%@ page import="java.util.*"%>
-
<html>
-
<head>
-
<%
-
response.setHeader("Cache-Control","no-cache"); //HTTP 1.1
-
response.setHeader("Pragma","no-cache"); //HTTP 1.0
-
response.setHeader("Expires", "-1"); //prevents caching at the proxy server
-
response.setDateHeader("Expires", 0); //prevents caching at the proxy server
-
-
%>
-
<link rel="stylesheet" type="text/css" href="../static/js/dojox/grid/_grid/Grid.css">
-
-
<script type="text/javascript" src="../static/js/dojo/dojo.js" djConfig="isDebug:false, parseOnLoad: true"></script>
-
<script type="text/javascript">
-
dojo.require("dojox.grid.Grid");
-
dojo.require("dojox.data.QueryReadStore");
-
dojo.require("dojo.data.ItemFileReadStore");
-
dojo.require("dojo.parser");
-
-
function getData(inRowIndex)
-
{
-
if((inRowIndex % 2) == 0)
-
return "<a href=\"#\" style=\"color: blue\">IBM</a>";
-
else
-
return "<a href=\"#\" style=\"color: blue\">CISCO</a>";
-
}
-
-
function getPr(inRowIndex)
-
{
-
if((inRowIndex % 3) == 0)
-
return "<img src=\"../static/images/pershingrule_indicator.gif\">"
-
}
-
-
-
dojo.addOnLoad(function() {
-
alert("addOnLoad");
-
(dijit.byId("grid")).setSortIndex(1,true);
-
});
-
-
-
function sort()
-
{
-
alert("sort");
-
grid.setSortIndex(1,true);
-
}
-
-
var col00 = {name:'Account #',colSpan:13,
-
headerStyles: 'background-image: none; background-color: #039;FONT-FAMILY: Arial, Verdana, Helvetica, san-serif;FONT-SIZE: 12px;FONT-WEIGHT:bold;COLOR: #FFF;'
-
-
};
-
-
-
-
var col0 = {name:'Account #',field:'account',width:5,
-
headerStyles: 'background-image: none; background-color: #039;FONT-FAMILY: Arial, Verdana, Helvetica, san-serif;FONT-SIZE: 12px;FONT-WEIGHT:bold;COLOR: #FFF;'
-
-
};
-
-
var col1 = {name:'Trade Ref#',field:'tradeRef',width:7,
-
headerStyles: 'background-image: none; background-color: #C6942B;FONT-FAMILY: Arial, Verdana, Helvetica, san-serif;FONT-SIZE: 12px;FONT-WEIGHT:bold;COLOR: #FFF;'
-
};
-
-
var col2 = {name:'<a href="#" style="color: white">TD</a>',field:'td',width:3,
-
headerStyles: 'background-image: none; background-color: #039;FONT-WEIGHT:bold;'
-
-
};
-
var col3 = {name:'<a href="#" style="color: white">SD</a>',field:'sd',width:5,
-
headerStyles: 'background-image: none; background-color: #006666;FONT-WEIGHT:bold;'
-
};
-
var col4 = {name:'<a href="#" style="color: white">IBD</a>',field:'ibd',width:5,
-
headerStyles: 'background-image: none; background-color:#039;FONT-WEIGHT:bold;'
-
};
-
var col5 = {name:'<a href="#" style="color: white">Exch</a>',field:'exch',width:5,
-
headerStyles: 'background-image: none; background-color:#039;FONT-WEIGHT:bold;'
-
};
-
var col6 = {name:'<a href="#" style="color: white">Side</a>',field:'side',width:5,
-
headerStyles: 'background-image: none; background-color:#039;FONT-WEIGHT:bold;'
-
};
-
var col7 = {name:'<a href="#" style="color: white">Symbol</a>',
-
field:'symbol',get:getData,width:5,
-
headerStyles: 'background-image: none; background-color:#039;FONT-WEIGHT:bold;'
-
};
-
-
var col8 = {name:'<a href="#" style="color: white">PR</a>',field:'qty',get:getPr,width:5,
-
headerStyles: 'background-image: none; background-color:#039;FONT-WEIGHT:bold;'
-
};
-
var col9 = {name:'<a href="#" style="color: white">Price</a>',field:'price',width:5,
-
headerStyles: 'background-image: none; background-color:#039;FONT-WEIGHT:bold;'
-
};
-
var col10 = {name:'<a href="#" style="color: white">Money</a>',field:'money',width:5,
-
headerStyles: 'background-image: none; background-color:#039;FONT-WEIGHT:bold;',classes:"greenColumn"
-
};
-
-
var col11 = {name:'<a href="#" style="color: white">SI/SO</a>',field:'siso',width:5,
-
headerStyles: 'background-image: none; background-color:#039;FONT-WEIGHT:bold;'
-
};
-
-
-
var col12 = {name:'FM',field:'fm',width:5,
-
headerStyles: 'background-image: none; background-color: #039;FONT-FAMILY: Arial, Verdana, Helvetica, san-serif;FONT-SIZE: 12px;FONT-WEIGHT:bold;COLOR: #FFF;'
-
};
-
-
-
var structure = [
-
{
-
cells: [[
-
col0,
-
col1,
-
col2,
-
col3,
-
col4,
-
col5,
-
col6,
-
col7,
-
col8,
-
col9,
-
col10,
-
col11,
-
col12
-
-
]
-
]
-
}
-
];
-
-
</script>
-
</head>
-
<body >
-
-
<a href="#" onClick="sort(); return false;">sort</a>
-
-
<div dojoType="dojox.data.QueryReadStore" jsId="jananee", url="DojoGrid/jsp/testQueryDSController.jsp" requestMethod="post"></div>
-
-
<div dojoType="dojox.grid.data.DojoData" jsId="model" rowsPerPage="20" store="jananee" query="{ namespace: '*' }"></div>
-
-
<div id="grid" jsId="grid" dojoType="dojox.grid.Grid" model="model" structure="structure" delayScroll="true"></div>
-
-
</body>
-
</html>
-
-
-
By default, my first column is not getting sort... But when i click sort link its workin fine..... How can i overcome this... pl do help me...
You don't seem to have added the clientSort attribute.
Also, is it not supposed be 0 for the sort index if you want to sort the first column?
Hi all,
How do i sort the numeric data in the column of dojo grids using table...
pl help... Thanks in Advance...
You may find the available JS's table sorting components (free of cost) useful.
Just google for "sortable table javascript", or some similar keywords.
Merged threads since they seem to be relating to a similar problem.
Sign in to post your reply or Sign up for a free account.
Similar topics
by: richard |
last post by:
OK, I have got bi-directional datagrid sorting down, have a created a
nice sorting class. My question, how can I add sorting to more than one
datagrid on the same page? Everything I have tried has...
|
by: ReneMarxis |
last post by:
Hello
i have one problem with sorting in an unbound DataGridView. I set
sorting to automatic but i get errors when having DBNull values in the
column that gets sort ("Object must be of type...
|
by: raknin |
last post by:
Hi,
Hi,
Now that I am handle the way of use the dojo combobox I moving to the next stage. What I want to do is updating a second combobox automatically when a value is selected in the first...
|
by: gaya3 |
last post by:
Hi,
In Dojo Grids,is it possible to group a set of columns and give a common header for this group.
It is almost like summary row but i don't want to display the row in data part(display only...
|
by: gaya3 |
last post by:
Hi,
can anyone find error in the following example
<%@ include file="JspBean.jsp" %>
<%@ page import="java.util.*"%>
<html>
<head>
<%
|
by: gaya3 |
last post by:
Hi,
How to perform multi column sorting in dojo grids...
pl help.....Thnaks in Advance.....
|
by: gaya3 |
last post by:
Hi,
I have used dojo framework in my project.There is a question that make me annoyed -- the memory leak.The target web browser is mainly the IE.
My projects consists of two screens.Both screens...
|
by: kokababu |
last post by:
I am trying to load dojo module from different domain; such as dojo.parser, dijit.form.TextBox etc.
<html>
<head>
<script type="text/javascript">
djConfig = {
isDebug: true,...
|
by: ashutoshjoshi10 |
last post by:
Hi,
I am using a Dijit.form.filteringSelect to display values using the dojox.data.QueryReadStore. But, after overriding _filterResponse() to format the data in a Dojo-parsable format, whatever...
|
by: DolphinDB |
last post by:
Tired of spending countless mintues downsampling your data? Look no further!
In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
|
by: ryjfgjl |
last post by:
ExcelToDatabase: batch import excel into database automatically...
|
by: ArrayDB |
last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
|
by: CloudSolutions |
last post by:
Introduction:
For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
|
by: Defcon1945 |
last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
|
by: Shællîpôpï 09 |
last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
|
by: af34tf |
last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
|
by: Faith0G |
last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome former...
| |