<?xml version="1.0" encoding="UTF-8"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
<channel>
	<title>jQuery Grid Plugin - jqGrid - Topic: REAL EASY QUESTION !:  Can you use javascript within a grid cell</title>
	<link>http://www.trirand.com/blog/?page_id=393/discussion/real-easy-question-can-you-use-javascript-within-a-grid-cell</link>
	<description><![CDATA[Grid plugin]]></description>
	<generator>Simple:Press Version 5.7.5.3</generator>
	<atom:link href="http://www.trirand.com/blog/?page_id=393/discussion/real-easy-question-can-you-use-javascript-within-a-grid-cell/rss" rel="self" type="application/rss+xml" />
        <item>
        	<title>ericnickus on REAL EASY QUESTION !:  Can you use javascript within a grid cell</title>
        	<link>http://www.trirand.com/blog/?page_id=393/discussion/real-easy-question-can-you-use-javascript-within-a-grid-cell#p5866</link>
        	<category>Discussion</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/discussion/real-easy-question-can-you-use-javascript-within-a-grid-cell#p5866</guid>
        	        	<description><![CDATA[<p>yeah , that was it.&#160; The only way it can work that I know of .. Thanks dude.</p>
]]></description>
        	        	<pubDate>Mon, 06 Apr 2009 11:27:01 +0300</pubDate>
        </item>
        <item>
        	<title>ericnickus on REAL EASY QUESTION !:  Can you use javascript within a grid cell</title>
        	<link>http://www.trirand.com/blog/?page_id=393/discussion/real-easy-question-can-you-use-javascript-within-a-grid-cell#p5846</link>
        	<category>Discussion</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/discussion/real-easy-question-can-you-use-javascript-within-a-grid-cell#p5846</guid>
        	        	<description><![CDATA[<p>sorry , I for got to show you the code (oops)</p>
</p>
<p>code for the player (it&#39;s a pretty popular one too , if there even Are any other good free ones.)</p>
</p>
<p>&#60;p id="audioplayer_1"&#62;Flashplayer Error&#60;/p&#62;&#160;&#160;&#160; <br />&#160;&#160;&#160;&#160;&#160;&#160; &#60;script type="text/javascript"&#62;&#160; <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; AudioPlayer.embed("audioplayer_1", {soundFile: "http://solicitedmaterial.net /audio-audition_files/AH-dirty.mp3"});&#160; <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#60;/script&#62;</p></p>
]]></description>
        	        	<pubDate>Fri, 03 Apr 2009 18:36:43 +0300</pubDate>
        </item>
        <item>
        	<title>ericnickus on REAL EASY QUESTION !:  Can you use javascript within a grid cell</title>
        	<link>http://www.trirand.com/blog/?page_id=393/discussion/real-easy-question-can-you-use-javascript-within-a-grid-cell#p5845</link>
        	<category>Discussion</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/discussion/real-easy-question-can-you-use-javascript-within-a-grid-cell#p5845</guid>
        	        	<description><![CDATA[<p>Thanks for your reply;&#160; I am getting closer !&#160;&#160; I tried to pass in this to the grid for one cell .... If I just put this code on the page by itself, it shows a nice audioplayer with a volume button and play button and works.&#160; .&#160;&#160; .&#160;&#160;</p>
<p>Try to put it in a cell of the grid and I get this error</p>
<p><strong>ob.toString is not a function</strong></p>
<p><a href="http://localhost:1947/WebSite3/js/min/grid.base-min.js" rel="nofollow" target="_blank"><a href="http://localhost:1947/WebSite3" rel="nofollow">http://localhost:1947/WebSite3</a>.....ase-min.js</a><br />Line 9</p>
</p>
<p>I&#39;m going to try the div thing right now</p></p>
]]></description>
        	        	<pubDate>Fri, 03 Apr 2009 18:32:23 +0300</pubDate>
        </item>
        <item>
        	<title>tony on REAL EASY QUESTION !:  Can you use javascript within a grid cell</title>
        	<link>http://www.trirand.com/blog/?page_id=393/discussion/real-easy-question-can-you-use-javascript-within-a-grid-cell#p5826</link>
        	<category>Discussion</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/discussion/real-easy-question-can-you-use-javascript-within-a-grid-cell#p5826</guid>
        	        	<description><![CDATA[<p>Hello,</p>
<p>Not sure if this will help, but you can try. An every last two cells add a div tag with id.</p>
<p>&#60;div id=&#8221;divid_1&#8243;&#62;&#60;/div&#62;</p>
<p>Then (just for test) try</p>
<p>$(&#8221;#divid_1&#8243;).load(&#8221;myfile.html&#8221;);</p>
<p>where myfile.html contain the above script. You known what I mean - load can load a script too.</p>
<p>Regards</p>
<p>Tony</p>
]]></description>
        	        	<pubDate>Fri, 03 Apr 2009 07:42:00 +0300</pubDate>
        </item>
        <item>
        	<title>ericnickus on REAL EASY QUESTION !:  Can you use javascript within a grid cell</title>
        	<link>http://www.trirand.com/blog/?page_id=393/discussion/real-easy-question-can-you-use-javascript-within-a-grid-cell#p5820</link>
        	<category>Discussion</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/discussion/real-easy-question-can-you-use-javascript-within-a-grid-cell#p5820</guid>
        	        	<description><![CDATA[<p>Yes sir, there is a matter of fact a nice problem ; I had my grid working nicely, with 4 cells on each row,&#160; 2 contain regular data and 2 contain&#160; a html string which is essentially an embedded flash audioplayer (wordpress - the old one ) so it has like a song title , artist name, and 2 audition mp3s which can be listened to for each song. . so the whole page is full of these embedded flash objects&#160; (the html is like this:)</p>
<pre id="line62"> &#60;<span class="start-tag">object</span><span class="attribute-name"> type</span>=<span class="attribute-value">application/x-shockwave-flash </span><span class="attribute-name">data</span>=<span class="attribute-value">http://www.mysite.net/audio/player.swf </span><span class="attribute-name">id</span>=<span class="attribute-value">audioplayer1 </span><span class="attribute-name">height</span>=<span class="attribute-value">16 </span><span class="attribute-name">width</span>=<span class="attribute-value">175</span>&#62;&#60;<span class="start-tag">param</span><span class="attribute-name"> name</span>=<span class="attribute-value">movie </span><span class="attribute-name">value</span>=mysite<span class="attribute-value">.net/audio/player.swf </span><span class="error"><span class="attribute-name">/</span></span>&#62;&#60;<span class="start-tag">param</span><span class="attribute-name"> name</span>=<span class="attribute-value">FlashVars </span><span class="attribute-name">value</span>=<span class="attribute-value">playerID=1&#38;amp;soundFile=http://www.mysite.net/audio/JCIN-alone_B_no_bell.mp3 </span><span class="error"><span class="attribute-name">/</span></span>&#62;&#60;<span class="start-tag">param</span><span class="attribute-name"> name</span>=<span class="attribute-value">quality </span><span class="attribute-name">value</span>=<span class="attribute-value">high </span><span class="error"><span class="attribute-name">/</span></span>&#62;&#60;<span class="start-tag">param</span><span class="attribute-name"> name</span>=<span class="attribute-value">menu </span><span class="attribute-name">value</span>=<span class="attribute-value">false </span><span class="error"><span class="attribute-name">/</span></span>&#62;&#60;<span class="start-tag">param</span><span class="attribute-name"> name</span>=<span class="attribute-value">wmode </span><span class="attribute-name">value</span>=<span class="attribute-value">transparent </span><span class="error"><span class="attribute-name">/</span></span>&#62;&#60;<span class="start-tag">object</span><span class="error"><span class="attribute-name">/</span></span>&#62;<br /><br />I get it from a asp.net webservice called from javascript, and it returns a good array<br />&#160;of &#39;song&#39; objects ( I have a simple song class(.cs) defined), and somehow asp.net <br />does all the JSON stuff , so I caught a break there.   So you can see my grid code<br />below (next) i already have the data so I define data :local,  or clientside .  I still <br />don&#39;t get whether or not I should put  a fake url or not?   Ok heres the code ( I <br />didn&#39;t use document.ready, so please don&#39;t send me packing back to the drawing<br />board just yet, because I don&#39;t want the grid to show on page load.  anyways here<br /> it is:<br /><br />    function OnComplete(result) {<br /><br />         if (result != null) {<br /><br />             jQuery("#list2").jqGrid({<br />                 datatype: "local",      <br />                 height: "400",<br /><br />                 colNames: [&#39;Title&#39;, &#39;Artist&#39;, &#39;Auditionplayer&#39;, &#39;Editorplayer&#39;],<br />                 colModel: [<br />    { name: &#39;title&#39;, index: &#39;title&#39;, width: 175 },<br />     { name: &#39;artist&#39;, index: &#39;artist&#39;, width: 175 },<br />      { name: &#39;auditionurl&#39;, index: &#39;auditionurl&#39;, width: 175, align: "left" },<br />       { name: &#39;editauditionurl&#39;, index: &#39;editauditionurl&#39;, width: 175, align: "left" }<br />     ],<br />                viewrecords: true,<br />                caption: "SongList"<br /><br />             });<br />             jQuery("#list2").clearGridData();<br />                    var _songs = result;<br />             <br />                    for (var i = 0; i &#60;= _songs.length; i++) {<br />                        jQuery("#list2").addRowData(i + 1, _songs[i]);         <br />                 <br />            }}}<br /> //-----------------------------------------------------------------------------------------------        <br />//       the javascript that returns the array from the web service is this:<br />//           <br />//       ret = Songservice.GetSongData(OnComplete, OnError, OnTimeOut);<br />//------------------------------------------------------------------------------------------------<br /><br />Ok so here&#39;s the problem; It works great in FF and Safari, ((If I have the right <br />version of adobe flash ))  {there are at least 2 versions, and you need the firefox, safari<br />version installed to have it working fine in FF, etc.  but there is also a IE version ( you can see<br />this one coming )   DOESN"T Work in IE 7 and 8.  So After about 3 days of trying <br />to find out what somebody else already figured out ((don&#39;t you hate that?)) microsoft<br />is changing the way IE handles an embedded flash object.  so, now instead of the html <br />string (above) there is a javascript function that will do it, and supposedlyif the content <br />is an external javascript file, the whole embedded flash thing doesn&#39;t bother IE and it <br />MIGHT ? work, so I tried it on the page and it works, but I need to dynamically load <br />2 of these for every song in a list, and the script changes with each row of data, pointing<br />to another ,mp3 file, and naming the audioplayer, #1, 2, 3, ... etc. <br /><br />So the thing I would like to do , is to pass in this code:<br />-----------------------------------------------------------------------------<br /><br /> &#60;p id="audioplayer_1"&#62;Alternative content&#60;/p&#62;  <br />         &#60;script type="text/javascript"&#62;  <br />               AudioPlayer.embed("audioplayer_1", {soundFile: "http://yoursite.com/path/to/mp3_file.mp3"});  <br />         &#60;/script&#62;  <br /><br />&#60;p id="audioplayer_2"&#62;Alternative content&#60;/p&#62;  <br />         &#60;script type="text/javascript"&#62;  <br />             AudioPlayer.embed("audioplayer_2", {soundFile: "http://yoursite.com/path/to/mp3_file_2.mp3"});  <br />         &#60;/script&#62;<br />----------------------------------------------------------------------------------------------------<br />&#160;for the last 2 cells on each row <br />( you can see how this has to be altered for each script.) And supposedly everyone using <br />an embedded flash player will come to terms with this !##$ for IE 7 and 8 (and the upgrades<br />to 6 have it too )!$@##$.  Hopefully it will work then like the flash player experts say it will.  <br />So my questions to the javascript guru dude  (that may be you apparently), are these:<br /><br /></pre>
<ul>
<li>1.)  should I attempt to pass this in as a string like I did with the html?</li>
</ul>
<ul>
<li>2.) should I try to create a div tag for the cell or use the existing naming and do a document.write or force an append child to get the data in there? </li>
</ul>
<ul>
<li>I&#39;m pretty sure&#160; getDocumentById("area").innerHTML  won&#39;t work for this.  it doesn&#39;t. </li>
</ul>
<ul>
<li>3.) I was trying a setCell for each row, but this is kinda messy and it didn&#39;t really like it</li>
</ul>
<ul>
<li>4.) should I write a different type of jqgrid method for IE only?</li>
</ul>
<pre id="line62"><br /><strong>I know this is not the fault of the grid</strong>, but I promise when I get this thing working right<br />I will post a full example for the users of this site, because I had to go through a lot just  <br />  i e; reading &#39;how to uninstall and reinstall flash player&#39; (wasted lots of time. ) to find out that microsoft is changing a couple of things in IE 6 update, forward.  <br />And read alll 80 pages of the HELP forum before finding out it is really an IE problem and <br />the solution is to have the embedded flash object in a javascript file (I read external, but if<br />the code has &#60;script&#62;,...... &#60;/script &#62; tags in the grid, that would be the same as an external <br />js call, right?<br /><br />I have so much to learn about javascript, and I hate to waste it on IE and cross browser issues, <br />i am willing to share this information here when it works, because someone will definitely want to <br />have an audioplayer, and I have looked at other sites with it, it doesn&#39;t work right on lots of peoples <br />published sites (they didn&#39;t check it I guess , or gave up ) <em> I know the key is to use the javascript to <br />call the embedded flash player, </em><br /> Any suggestions:?<br /><br />thanks.  <br /><br />p.s. Tony,  thanks for all your work on this plug in,  it&#39;s very useful. and your documentation<br /> is very good. Is there a way we can rate the HELP forum, or further break it down?  because it takes a bit <br />of effort to read through 80 pages.  I think all this kind of MS and IE incompatibility issues should be posted in HUGE<br />letters on the home page of microsoft.com.  Maybe they&#39;re trying to get IE to be more compatible with <br />Vista&#62;?   ( giggling )   Is it going to be like this all through javascript and jquery with the IE issues?<br /><br />p.s.s., is there open source for the button in this editor that says insert/edit embedded media  ?? I&#39;d love to see it<br /><br /><br />the sickest -  <br /> <a href="mailto:ericnickus@roadrunner.com" target="_blank">ericnickus@roadrunner.com</a><br /></pre>
<pre id="line62"><br /></pre>
]]></description>
        	        	<pubDate>Fri, 03 Apr 2009 06:53:34 +0300</pubDate>
        </item>
        <item>
        	<title>tony on REAL EASY QUESTION !:  Can you use javascript within a grid cell</title>
        	<link>http://www.trirand.com/blog/?page_id=393/discussion/real-easy-question-can-you-use-javascript-within-a-grid-cell#p5809</link>
        	<category>Discussion</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/discussion/real-easy-question-can-you-use-javascript-within-a-grid-cell#p5809</guid>
        	        	<description><![CDATA[<p>Hello,</p>
<p>Is there a problem to try?&#160; I never try this.</p>
<p>Regards</p>
<p>Tony</p>
]]></description>
        	        	<pubDate>Fri, 03 Apr 2009 02:48:21 +0300</pubDate>
        </item>
        <item>
        	<title>ericnickus on REAL EASY QUESTION !:  Can you use javascript within a grid cell</title>
        	<link>http://www.trirand.com/blog/?page_id=393/discussion/real-easy-question-can-you-use-javascript-within-a-grid-cell#p5796</link>
        	<category>Discussion</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/discussion/real-easy-question-can-you-use-javascript-within-a-grid-cell#p5796</guid>
        	        	<description><![CDATA[<p>can you make the contents of a cell, &#60;script&#62; ... &#60;/script&#62;&#160; containing javascript?</p></p>
]]></description>
        	        	<pubDate>Thu, 02 Apr 2009 17:55:24 +0300</pubDate>
        </item>
</channel>
</rss>