row height

Questionsrow height
Sascha asked 7 years ago

Hello

where can I change the row height?
The height should be 15px. But it is only 25px.
I took this order.

$col["formatter"] = "function(cellval,options,rowdata){ return '<div style="height:15px; overflow:hidden;">'+cellval+'</div>'; }";

Can someone tell me how I managed it is the rows 15px high ?.

5 Answers
Abu Ghufran answered 7 years ago

You can put this css on page after including css files.

<style>
/* increase font & row height */
.ui-jqgrid *, .ui-widget, .ui-widget input, .ui-widget select, .ui-widget textarea, .ui-widget button { font-size:10px; }
.ui-jqgrid tr.jqgrow td { height:15px; }
</style>

Sascha answered 7 years ago

Hi, works perfectly.

Can you tell me where i can adjust the rows with different colors.

example:

yellow
blue
yellow
blue
yellow

usw….

Abu Ghufran answered 7 years ago

Enable alternate rows option, and add this css:

$opt["altRows"] = true;
$opt["altclass"] = "myAltRowClass";
$g->set_options($opt);

and in html …

<style>
/* base row color */
.ui-jqgrid tr.jqgrow { background-color: yellow; background-image: url('') !important; }

/* alternate row color */
.myAltRowClass { background-color: blue !important; background-image: url('') !important; }
</style>

Sascha answered 7 years ago

It works very fine.

I open the phpgrid over a link, I can give the link parameter, so that when opening the phpgrid is already made a preselection?

Abu Ghufran answered 7 years ago

You can connect loadComplete event and in JS callback, you can call setSelection function to select desired row id.

$grid["loadComplete"] = "function(){ do_onload(); }";
$g->set_options($grid);

To select / unselect grid row, e.g. rowid 5
jQuery('#list1').jqGrid('setSelection', 5, true);

You can replace 5 with <?php echo $_GET["param"] ?>

Your Answer

19 + 16 =

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?