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_Related Related Topics sp_TopicIcon
data concatination
08/06/2010
20:11
Avatar
Energetic Pixels
Lexington, OK, USA
Member
Members
Forum Posts: 40
Member Since:
12/04/2010
sp_UserOfflineSmall Offline

I am using jqGrid 3.6.4.  In my onSelectRow, I am trying to develop an iterated <li></li> set for each picture data within a static xml file.  This picture data then gets "appended" into a specific <div> to be used by galleriffic slide show application.  I know galleriffic can handle 'stacked' <li></li> sets when I tested it through hard-coding.  When the xml file only has one set of picture data (one picture associated with object), my application works just fine between jqGrid and Galleriffic.  Problem comes in when there are multiple picture data.  jqGrid is concatinating all the urls together (one right after another one) and then it concatinates the titles together (one right after another one), instead of developing the 'stacked' <li></li> like I want it to.  Any suggestions on how I can get jqGrid to change its mind on how it sees multiple pictures???

here is my portion of onSelectRow script:

$('#thumbs ul').append("<li><a class='thumb' href='" + data.piclocation + "' title='" + data.pictitle + "'><img src='" + data.picthumb + "' alt='" + data.pictitle + "' /></a><div class='caption'><div class='image-title'>" + data.pictitle + "</div></div></li>"); 

And here is the portion of my xml file (5 pictures to be script developed):

<photo>
<pic>
<asset>weaponLib/stillMedia/slides/A106.jpg</asset>
<thumb>weaponLib/stillMedia/thumbs/A106.jpg</thumb>
<caption>Side view of DODIC A106</caption>
<title>Side view of 22 caliber long rifle ball cartridge</title>
</pic>
<pic>
<asset>weaponLib/stillMedia/slides/A106_A.jpg</asset>
<thumb>weaponLib/stillMedia/thumbs/A106_A.jpg</thumb>
<caption>Side view of DODIC A106</caption>
<title>Side view of 22 caliber long rifle ball cartridge</title>
</pic>
<pic>
<asset>weaponLib/stillMedia/slides/A106_B.jpg</asset>
<thumb>weaponLib/stillMedia/thumbs/A106_B.jpg</thumb>
<caption>Side view of DODIC A106</caption>
<title>Side view of 22 caliber long rifle ball cartridge</title>
</pic>
<pic>
<asset>weaponLib/stillMedia/slides/A106_C.jpg</asset>
<thumb>weaponLib/stillMedia/thumbs/A106_C.jpg</thumb>
<caption>Side view of DODIC A106</caption>
<title>Side view of 22 caliber long rifle ball cartridge</title>
</pic>
<pic>
<asset>weaponLib/stillMedia/slides/A106_D.jpg</asset>
<thumb>weaponLib/stillMedia/thumbs/A106_D.jpg</thumb>
<caption>Side view of DODIC A106</caption>
<title>Side view of 22 caliber long rifle ball cartridge</title>
</pic>
</photo>

Here is how it comes out in my DOM (IE7/8 Developer Tools):

<li class="selected" style="filter: alpha(opacity=100); ZOOM: 1;" jQuery1276015362777="156">

<a title="Side view of 22 caliber long rifle ball cartridgeSide view of 22 caliber long rifle ball cartridgeSide view of 22 caliber long rifle ball cartridgeSide view of 22 caliber long rifle ball cartridgeSide view of 22 caliber long rifle ball cartridge" class="thumb" submitName="" href="#1" rel="history" jQuery1276015362777="151">

<img alt="Side view of 22 caliber long rifle ball cartridgeSide view of 22 caliber long rifle ball cartridgeSide view of 22 caliber long rifle ball cartridgeSide view of 22 caliber long rifle ball cartridgeSide view of 22 caliber long rifle ball cartridge" src="http://localhost/ameLib/weapon.....;/&gt;

jqGrid then closes my <li> tag.

How do I get jqGrid to quit concatinating the data??  It is probably something quite simple.

A working online version of my application can be seen at serco-hrc.com/testMe/index.html.   Select "ok", then small arms menu.

to see the multiple item issue, select Dodic A106 (third one down on the jqGrid).  Then select "slideshow" on the resulting tab that opens.  The first two DODICs listed in the jqGrid work just fine if you wnat to see it work.

TonyConfused CryFrown

16/06/2010
13:37
Avatar
tony
Sofia, Bulgaria
Moderator
Members

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

Hello,

I'm not sure that I understand the problem. Also jqGrid does not closes any <li> tag. The problem is maybe how you write this long string.

I suggest you first to try with simple tags without classes and data and see if this work, then add step by step additional code and see the result.

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.

17/06/2010
18:59
Avatar
Energetic Pixels
Lexington, OK, USA
Member
Members
Forum Posts: 40
Member Since:
12/04/2010
sp_UserOfflineSmall Offline

Tony,

    Ok, I know my string works when my application (through xml file) only has one picture to display.  It generates an appropriate <LI></LI> tag.

   My problem arises when the xml file has multiple <pic> elements that jqGrid must iterate through to generate the stacked <li></li> tags.  I can see my problem when I dig into the DOM via IE Web Developer. I am at a loss as to how to get jqGrid to sequence properly.  I can see in the DOM where jqGrid is generating the table.  Inside the <td> tag for the images, jqGrid is grabbing ALL of the pic URLs and putting them all together as one URL (concatinated).  It does the same thing to the title portion too.

    I put a copy of the application up on my temp site (http://www.serco-hrc.com/testM.....index.html).  Small Arms -> A085 builds the <li></li> tag correctly.  Small Arms -> A106 has multiple pics (i.e., multiple <li></li> tags) to build.  Make sure that you refresh your browser between viewing the rows as I have not developed the script to kill the cache from a previous operation.

I don't konw why jqGrid would work fine in one instance and not in another when the same script is doing the operation.  I can see what it is doing wrong, just lost as to how to fix it.

Tony ConfusedCryFrown

Forum Timezone: Europe/Sofia

Most Users Ever Online: 715

Currently Online:
56 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