Forum

November 2nd, 2014
A A A
Avatar

Lost password?
Advanced Search

— Forum Scope —




— Match —





— Forum Options —





Minimum search word length is 3 characters - maximum search word length is 84 characters

The forums are currently locked and only available for read only access
sp_Feed Topic RSS sp_TopicIcon
New Questions
16/09/2008
16:17
Avatar
Larry D
Larry D
Member
Members
Forum Posts: 30
Member Since:
16/09/2008
sp_UserOfflineSmall Offline

Great grid Tony. I have configured the grid for an app pretty good but I have a few questions I can not find the answers to in the docs or here.

1. Userdata Totals
Using the New in version 3.1, Toolbars and userdata example I am trying to use this with json.

loadComplete: function() {
var udata = $(”#a_all”).getUserData();
$(”#t_a_all”).html(”
Totals Wins:”+udata.t_wins+” ”);
}

$response->page = $page;
$response->total = $total_pages;
$response->records = $count;
$response->t_wins = $t_wins;

This bulds the json string as:

{”page”:”1″,”total”:3,”records”:”21″,”t_wins”:”3509″,…..

But the totals bar shows: Totals Wins:undefined.

Is this a problem with my javascript or php?

2. Change Cell Colors
I have successfully used the afterInsertRow:, setCell function to change the colors of cells. There are about 10 columns though and with a 10 row grid this is a lot of extra code.

I am wondering if this is efficient or if the cell coloring should be done on the php side and passed via the json string?

Note I can’t use row coloring as cells can be different colors for each column.

3. Dynamic Height of Grid
I have the following:

rowNum:10, rowList:[10,20,30], height:185,

This works fine as all 10 rows are shown with no scroll bars. If I change the rowlist on screen to 20 the grid stays the same size but adds scroll bars so that the full 20 rows can be seen. This scroll bar eats into screen real estate so is it possible to dynamic change the height to 370 if 20 rows is selected?

4. Links in Cell Breaks Edit
One of the column has clickable links so that users can go to a new page. This works in that clicking a cell will open the link but it breaks the editing. Rows with links in produce edit page:

Edit Record, Submit Cancel

No data is displayed.

The json file is:

“rows”:[["<a target=\\"_BLANK\\" href=\\"\\/widgets.php?stat=100&name=Johnston&valid=3&id=45714\\">45714","Yes" ...

I tried wrapping in <![CDATA[ ]] but that does then not render the column correctly.

TIA.

17/09/2008
05:03
Avatar
tony
Sofia, Bulgaria
Moderator
Members

Moderators
Forum Posts: 7721
Member Since:
30/10/2007
sp_UserOfflineSmall Offline

Hello,

Step by Step:

1. The expression $response->t_wins = $t_wins;  is wrong.

The right is

$response->userdata = array('t_wins'=>$t_wins,...);

2. If every cell should have diffrent color this is the right way,

but it depend how many cells do you want to color. Of course if

they are too much I think the better way to do that is server side.

3. Set the option (as of the docs) height: '100%', but I recommend

to use height:'auto' which work crossbrowser. The '100%' does not

work correct in Safari.

4. You are right about this, but we need in this case a cell editor.

This is not trivial work. If you use formedit I recomend you to add a

extra hidden column with the value of the link column. Make link column

not editable, but set for the hidden column: editrules:{edithidden:true}

If you use reloadAfterSubmit: false then you should manully update the

link column using maybe afterSubmit event.

Best Regards

Tony

For professional UI suites for Java Script and PHP visit us at our commercial products site - guriddo.net - by the very same guys that created jqGrid.

19/09/2008
15:40
Avatar
Larry D
Larry D
Member
Members
Forum Posts: 30
Member Since:
16/09/2008
sp_UserOfflineSmall Offline

Thank you Tony. All answers worked well.

Forum Timezone: Europe/Sofia

Most Users Ever Online: 715

Currently Online:
82 Guest(s)

Currently Browsing this Page:
1 Guest(s)

Top Posters:

OlegK: 1255

markw65: 179

kobruleht: 144

phicarre: 132

YamilBracho: 124

Renso: 118

Member Stats:

Guest Posters: 447

Members: 11373

Moderators: 2

Admins: 1

Forum Stats:

Groups: 1

Forums: 8

Topics: 10592

Posts: 31289

Newest Members:

, razia, Prankie, psky, praveen neelam, greg.valainis@pa-tech.com

Moderators: tony: 7721, Rumen[Trirand]: 81

Administrators: admin: 66

Comments are closed.
Privacy Policy   Terms and Conditions   Contact Information