grouping error

Questionsgrouping error
miro asked 11 years ago

If I turn on grouping I have this error:
…ORDER BY field asc, asc LIMIT 20 OFFSET 0

can you help me?
thanks

4 Answers
Abu Ghufran answered 11 years ago

Can you share the sample file. It's very difficult to tell with provided statements.

Abu Ghufran answered 11 years ago

This seems to be a bug when no sort field and order by is not defined.

For quick fix, please add following in setting grid options.

e.g.

$grid["sortname"] = 'client_id'; // by default sort grid by this field
$grid["sortorder"] = "desc"; // ASC or DESC

I'll be updating this fix in next releaser.

miro answered 11 years ago

here is page:
http://tempo.create.sk/skolenia/

PHP:

$g = new jqgrid();

$g->debug = TRUE;
$g->set_actions(array(
"add"=>true,
"edit"=>true,
"delete"=>true,
"rowactions"=>true,
"export"=>true,
"autofilter" => true,
"search" => "simple",
"inlineadd" => false,
"showhidecolumns" => false
)
);

$grid['caption'] ='Sample';
$grid['autowidth'] = true;
$grid['url'] = '?onlyContents=1';
$grid['editurl'] = '?onlyContents=1';
$grid['editurl'] = '?onlyContents=1';

$grid["grouping"] = true;
$grid["groupingView"] = array();
$grid["groupingView"]["groupField"] = array("ico");

$g->set_options($grid);

$g->table = "tempo__prihlaska";

$col = array();
$col['title'] = "Idečko";
$col['name'] = "id";
$col['editable'] = false;
$col['hidden'] = true;
$cols[] = $col;

$col = array();
$col['title'] = "Id kurzu";
$col['name'] = "id_kurzu";
$col['editable'] = true;
$col['hidden'] = true;
$cols[] = $col;

$col = array();
$col['title'] = "Názov kurzu";
$col['name'] = "nazov";
$col['editable'] = TRUE;
$col['link'] = $lang['webAddress'] . "c-{id_kurzu}";
$cols[] = $col;

$col = array();
$col['title'] = "Dátum konania";
$col['name'] = "datum";
$col['editable'] = TRUE;
$col['formatter'] = 'date';
$col['formatoptions'] = array("srcformat"=>'Y-m-d',"newformat"=>'d.m.Y');
$cols[] = $col;

$col = array();
$col['title'] = "Variabilný symbol";
$col['name'] = "vs";
$col['editable'] = TRUE;
$cols[] = $col;

$col = array();
$col['title'] = "Lektor";
$col['name'] = "id_lektor";
$col['editable'] = TRUE;
$cols[] = $col;

$col = array();
$col['title'] = "Miesto";
$col['name'] = "id_miesto";
$col['editable'] = TRUE;
$cols[] = $col;

$col = array();
$col['title'] = "Firma";
$col['name'] = "firma";
$col['editable'] = TRUE;
$cols[] = $col;

$col = array();
$col['title'] = "Ičo";
$col['name'] = "ico";
$col['editable'] = TRUE;
$cols[] = $col;

$g->set_columns($cols);

$out = $g->render("list1");

miro answered 11 years ago

thank you very much…

Your Answer

2 + 13 =

Login with your Social Id:

OR, enter

Attach code here and paste link in question.
Attach screenshot here and paste link in question.



How useful was this discussion?

Click on a star to rate it!

Average rating 0 / 5. Vote count: 0

No votes so far! Be the first to rate it.

We are sorry that this post was not useful for you!

Let us improve this post!

Tell us how we can improve this post?