<?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: cutomize edit problem</title>
	<link>http://www.trirand.com/blog/?page_id=393/bugs/cutomize-edit-problem</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/bugs/cutomize-edit-problem/rss" rel="self" type="application/rss+xml" />
        <item>
        	<title>tony on cutomize edit problem</title>
        	<link>http://www.trirand.com/blog/?page_id=393/bugs/cutomize-edit-problem#p12905</link>
        	<category>Bugs</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/bugs/cutomize-edit-problem#p12905</guid>
        	        	<description><![CDATA[<p>Hello,</p>
<p>What is exactley your problem? Any error?</p>
<p>What you expect ?</p>
<p>Which version of jqGrid?</p>
<p>It seems like your response does not match the colModel</p>
<p>Regards</p>
<p>Tony</p>
]]></description>
        	        	<pubDate>Fri, 11 Dec 2009 00:45:11 +0200</pubDate>
        </item>
        <item>
        	<title>sayed on cutomize edit problem</title>
        	<link>http://www.trirand.com/blog/?page_id=393/bugs/cutomize-edit-problem#p12866</link>
        	<category>Bugs</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/bugs/cutomize-edit-problem#p12866</guid>
        	        	<description><![CDATA[<p>hi</p>
<p>I am having problem to add in line buttions for edit,save,cancel. here is my code ...</p>
</p>
<p><strong>index.php</strong></p>
</p>
<p>&#60;html&#62; &#60;head&#62; &#60;title&#62;jqGrid Demo&#60;/title&#62;<br />&#160;&#60;link rel="stylesheet" type="text/css" media="screen" href="themes/coffee/grid.css" /&#62;<br />&#160; &#60;link rel="stylesheet" type="text/css" media="screen" href="themes/jqModal.css" /&#62; <br />&#160; &#60;link rel="stylesheet" href="css/calendar.css" media="screen"&#62;&#60;/link&#62;<br />&#60;script language="JavaScript" type="text/JavaScript" src="js/cms.js"&#62;&#60;/script&#62;<br />&#60;script language="JavaScript" type="text/javascript" src="js/calendar.js"&#62;&#60;/script&#62;<br />&#160; &#60;script src="jquery.js" type="text/javascript"&#62;&#60;/script&#62; <br />&#160; &#60;script src="jquery.jqGrid.js" type="text/javascript"&#62;&#60;/script&#62;<br />&#160;&#160; &#60;script src="js/jqModal.js" type="text/javascript"&#62;&#60;/script&#62; <br />&#160;&#160; &#60;script src="js/jqDnR.js" type="text/javascript"&#62;&#60;/script&#62;<br />&#160;&#160; &#60;script type="text/javascript"&#62;<br />&#160;&#160;&#160; jQuery(document).ready(function(){ jQuery("#list").jqGrid({ <br />&#160;&#160;&#160; url:&#39;example_j.php&#39;, <br />&#160;&#160;&#160; datatype: &#39;xml&#39;, <br />&#160;&#160;&#160; mtype: &#39;GET&#39;, <br />&#160;&#160;&#160; colNames:[&#39;Actions&#39;,&#39;Request From&#39;,&#39;Mobile No&#39;,&#39;Massege&#39;, &#39;Time&#39;,&#39;Call Type&#39;], <br />&#160;&#160;&#160; colModel :[{name:&#39;act&#39;,index:&#39;act&#39;, width:75,sortable:false},{name:&#39;request_from&#39;, index:&#39;request_from&#39;, width:150, align:&#39;center&#39;,editable:true,edittype:"text",editoptions: {size:10, maxlength: 30}}, {name:&#39;msisdn&#39;, index:&#39;msisdn&#39;, width:150,editable:true,edittype:"text",editoptions: {size:10, maxlength: 30}}, {name:&#39;msg_body&#39;, index:&#39;msg_body&#39;, width:350, sortable:false,editable:true,edittype:"text",editoptions: {size:10, maxlength: 30}}, {name:&#39;creation_time&#39;, index:&#39;creation_time&#39;, width:220, align:&#39;right&#39;,editable:true,edittype:"text",editoptions: {size:10, maxlength: 30}},&#160; {name:&#39;call_type&#39;, index:&#39;call_type&#39;, width:120, align:&#39;right&#39;,editable:true,edittype:"text",editoptions: {size:10, maxlength: 30}}], <br />&#160;&#160;&#160; <br />&#160;&#160;&#160; pager: jQuery(&#39;#pager&#39;), <br />&#160;&#160;&#160; rowNum:20, <br />&#160;&#160;&#160; rowList:[10,20,30], <br />&#160;&#160;&#160; sortname: &#39;creation_time&#39;, <br />&#160;&#160;&#160; sortorder: "desc", <br />&#160;&#160;&#160; width: 900, <br />&#160;&#160;&#160; height: "auto", <br />&#160;&#160;&#160; viewrecords: true, <br />&#160;&#160;&#160; imgpath: &#39;themes/coffee/images&#39;, <br />&#160;&#160;&#160; <br />&#160;&#160;&#160; gridComplete: function()<br />&#160;&#160;&#160; {<br />&#160;&#160;&#160; var ids = jQuery("#list").jqGrid(&#39;getDataIDs&#39;); <br />&#160;&#160;&#160; <br />&#160;&#160;&#160; &#160;&#160;&#160; for(var i=0;i &#60; ids.length;i++)<br />&#160;&#160;&#160; &#160;&#160;&#160; { var cl = ids[i];<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;be = "&#60;input style=&#39;height:22px;width:20px;&#39; type=&#39;button&#39; value=&#39;E&#39; onclick=\\"jQuery(&#39;#list&#39;).editRow(&#39;"+cl+"&#39;);\\" /&#62;";<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;se = "&#60;input style=&#39;height:22px;width:20px;&#39; type=&#39;button&#39; value=&#39;S&#39; onclick=\\"jQuery(&#39;#list&#39;).saveRow(&#39;"+cl+"&#39;);\\" /&#62;"; <br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;ce = "&#60;input style=&#39;height:22px;width:20px;&#39; type=&#39;button&#39; value=&#39;C&#39; onclick=\\"jQuery(&#39;#list&#39;).restoreRow(&#39;"+cl+"&#39;);\\" /&#62;";<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160;&#160; <br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160; jQuery("#list").jqGrid(&#39;setRowData&#39;,ids[i],{act:be+se+ce}); <br />&#160;&#160;&#160; &#160;&#160;&#160; &#160; <br />&#160;&#160;&#160; &#160;&#160;&#160; &#160; }<br />&#160;&#160;&#160; &#160;}, <br />&#160;&#160;&#160; editurl: "example_j.php",<br />&#160;&#160;&#160; caption: &#39;My first grid&#39; </p>
<p>&#160;&#160;&#160; }); <br />&#160;&#160;&#160; </p>
<p>&#160;&#160;&#160; &#160;var timeoutHnd; <br />&#160; var flAuto = false;<br />&#160;&#160; function doSearch(ev){ if(!flAuto)<br />&#160;&#160;&#160; return; // var elem = ev.target&#124;&#124;ev.srcElement; <br />&#160; if(timeoutHnd) <br />&#160;&#160;&#160;&#160; &#160;clearTimeout(timeoutHnd) <br />&#160; timeoutHnd = setTimeout(gridReload,500) } <br />&#160; <br />&#160; function gridReload()<br />&#160; {</p>
<p>&#160; &#160;&#160;&#160; &#160;var date_from = jQuery("#date_from").val();<br />&#160; &#160;&#160;&#160; &#160;var date_to = jQuery("#date_to").val(); <br />&#160;&#160;&#160; &#160;alert(date_from+" , "+date_to);<br />&#160;&#160;&#160; &#160;if(date_from=="" &#38;&#38; date_to !="")<br />&#160;&#160;&#160; &#160; {<br />&#160;&#160;&#160; &#160;&#160;&#160;&#160; &#160;&#160;&#160; alert("First Insert date to the Date From field ");<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; jQuery("#date_from").focus();<br />&#160;&#160;&#160; &#160;}<br />&#160;&#160;&#160; &#160;else<br />&#160;&#160;&#160; &#160;{<br />&#160;&#160; &#160;&#160;&#160; &#160;jQuery("#list").setGridParam({url:"example_j.php?date_from="+date_from+"&#38;date_to="+date_to,page:1}).trigger("reloadGrid"); <br />&#160;&#160;&#160; &#160;}<br />}<br />&#160;&#160;&#160; function enableAutosubmit(state)<br />&#160;&#160;&#160; { flAuto = state; <br />&#160;&#160;&#160; jQuery("#submitButton").attr("disabled",state); <br />&#160;&#160;&#160; } <br />&#160;&#160;&#160; <br />&#160;&#160;&#160; &#60;/script&#62;<br />&#160;&#160;&#160; <br />&#160;&#160;&#160;&#160; <br />&#160;&#160;&#160; &#60;/head&#62; <br />&#160;&#160;&#160; &#60;body&#62; <br />&#160;&#160; </p>
<p>&#160;&#160;&#160; &#60;div&#62; </p>
<p>&#160;&#160;&#160;&#160; &#60;br/&#62;&#160; Date From&#60;br /&#62; <br />&#160;&#160;&#160;&#160; &#60;input type="text" id="date_from" /&#62;&#60;input name="datebutton" type="button" onClick="displayCalendar(document.getElementById(&#39;date_from&#39;),&#39;yyyy/mm/dd&#39;,this,true)" value="Calendar" /&#62; &#60;/div&#62;<br />&#160;&#160;&#160;&#160; &#60;div&#62;&#160; Date To&#60;br&#62; <br />&#160;&#160;&#160;&#160;&#160; &#60;input type="text" id="date_to" /&#62;&#60;input name="datebutton" type="button" onClick="displayCalendar(document.getElementById(&#39;date_to&#39;),&#39;yyyy/mm/dd&#39;,this,true)" value="Calendar" /&#62; <br />&#160;&#160;&#160;&#160;&#160;&#160; &#60;div&#62;&#160; <br />&#160;&#160;&#160;&#160;&#160; <br />&#160;&#160;&#160;&#160;&#160;&#160; &#60;button onClick="gridReload()" id="submitButton" style="margin-left:30px;"&#62;Search&#60;/button&#62;<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#60;/div&#62; <br />&#160;&#160;&#160;&#160; <br />&#160;&#160;&#160; &#60;div style="text-align:center; width:100%; margin-left:150px"&#62;<br />&#160;&#160;&#160; &#60;div id="srccontents"&#62;&#60;/div&#62;<br />&#160;&#160;&#160; &#60;table id="list" class="scroll" &#62;&#60;/table&#62;<br />&#160;&#160;&#160;&#160; &#60;div id="pager" class="scroll" style="text-align:center;"&#62;&#60;/div&#62; <br />&#160;&#160;&#160; &#60;/div&#62;<br />&#160;&#160;&#160; &#60;/body&#62; <br />&#160;&#160;&#160; &#60;/html&#62;</p>
</p>
<p><strong>example_j.php</strong></p>
<p>&#60;?php <br />//include the information needed for the connection to MySQL data base server. <br />// we store here username, database and password <br />include("dbconfig.php");</p>
<p>// to the url parameter are added 4 parameters as described in colModel<br />// we should get these parameters to construct the needed query<br />// Since we specify in the options of the grid that we will use a GET method <br />// we should use the appropriate command to obtain the parameters. <br />// In our case this is $_GET. If we specify that we want to use post <br />// we should use $_POST. Maybe the better way is to use $_REQUEST, which<br />// contain both the GET and POST variables. For more information refer to php documentation.<br />// Get the requested page. By default grid sets this to 1. <br />$page = $_GET[&#39;page&#39;]; </p>
<p>// get how many rows we want to have into the grid - rowNum parameter in the grid <br />$limit = $_GET[&#39;rows&#39;]; </p>
<p>// get index row - i.e. user click to sort. At first time sortname parameter -<br />// after that the index from colModel <br />$sidx = $_GET[&#39;sidx&#39;]; </p>
<p>// sorting order - at first time sortorder <br />$sord = $_GET[&#39;sord&#39;]; </p>
<p>// if we not pass at first time index use the first column for the index or what you want<br />if(!$sidx) $sidx =1; </p>
<p>&#160;date_default_timezone_set(&#39;Asia/Dhaka&#39;);<br />//$current_date_time=date("Y/m/d");<br />$current_date_time="2009/06/04";</p>
<p>if(isset($_GET["date_from"])) <br />$date_from = $_GET[&#39;date_from&#39;]; <br />else $date_from = ""; </p>
<p>if(isset($_GET["date_to"]))<br />&#160;$date_to = $_GET[&#39;date_to&#39;]; <br />&#160;else $date_to = ""; <br />&#160;<br />&#160;//construct where clause <br />&#160;//AND time(creation_time) BETWEEN &#39;00:00:01&#39; AND &#39;23:59:59&#39;<br />&#160;$where = "WHERE 1=1 "; <br />&#160;if($date_from!=&#39;&#39; &#38;&#38; $date_to!=&#39;&#39;) <br />&#160;$where.= " AND creation_time BETWEEN &#39;$date_from%&#39; AND &#39;$date_to%&#39;"; <br />&#160;else if($date_from!=&#39;&#39;) <br />&#160;$where.= " AND creation_time LIKE &#39;$date_from%&#39;"; <br />&#160;else if($date_to!=&#39;&#39;) <br />&#160;$where.= " AND creation_time LIKE &#39;$date_to%&#39;"; </p>
<p>// connect to the MySQL database server <br />$db = mysql_connect($dbhost, $dbuser, $dbpassword) or die("Connection Error: " . mysql_error()); </p>
<p>// select the database <br />mysql_select_db($database) or die("Error connecting to db."); </p>
<p>// calculate the number of rows for the query. We need this for paging the result <br />$result = mysql_query("SELECT COUNT(*) AS count FROM outbox ".$where.""); <br />//$result = mysql_query("SELECT COUNT(*) AS count FROM invheader"); <br />$row = mysql_fetch_array($result,MYSQL_ASSOC); <br />$count = $row[&#39;count&#39;]; </p>
<p>// calculate the total pages for the query <br />if( $count &#62; 0 ) { <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; $total_pages = ceil($count/$limit); <br />} else { <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; $total_pages = 0; <br />} </p>
<p>// if for some reasons the requested page is greater than the total <br />// set the requested page to total page <br />if ($page &#62; $total_pages) $page=$total_pages;</p>
<p>// calculate the starting position of the rows <br />$start = $limit*$page - $limit;</p>
<p>// if for some reasons start position is negative set it to 0 <br />// typical case is that the user type 0 for the requested page <br />if($start &#60;0) $start = 0; </p>
<p>// the actual query for the grid data <br />//$SQL = "SELECT id, invdate, amount, tax,total, note FROM invheader ORDER BY $sidx $sord LIMIT $start , $limit"; <br />//echo "SELECT inbox_id,msisdn, msg_body, creation_time, out_telco,call_type, status FROM outbox ORDER BY $sidx $sord LIMIT $start , $limit";</p>
<p>$SQL = "SELECT inbox_id,msisdn, msg_body, creation_time, call_type,request_from FROM outbox ".$where." ORDER BY $sidx $sord LIMIT $start , $limit"; <br />$result = mysql_query( $SQL ) or die("Couldn&#39;t execute query.".mysql_error()); </p>
<p>// we should set the appropriate header information<br />if ( stristr($_SERVER["HTTP_ACCEPT"],"application/xhtml+xml") ) {<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; header("Content-type: application/xhtml+xml;charset=utf-8"); <br />} else {<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; header("Content-type: text/xml;charset=utf-8");<br />}<br />echo "&#60;?xml version=&#39;1.0&#39; encoding=&#39;utf-8&#39;?&#62;";<br />echo "&#60;rows&#62;";<br />echo "&#60;page&#62;".$page."&#60;/page&#62;";<br />echo "&#60;total&#62;".$total_pages."&#60;/total&#62;";<br />echo "&#60;records&#62;".$count."&#60;/records&#62;";</p>
<p>// be sure to put text data in CDATA<br />while($row = mysql_fetch_array($result,MYSQL_ASSOC)) {</p>
<p>echo "&#60;row id=&#39;". $row[inbox_id]."&#39;&#62;"; <br />echo "&#60;cell&#62;&#60;/cell&#62;";&#160;&#160; <br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; echo "&#60;cell&#62;". $row[request_from]."&#60;/cell&#62;";&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; echo "&#60;cell&#62;". $row[msisdn]."&#60;/cell&#62;";<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; echo "&#60;cell&#62;". $row[msg_body]."&#60;/cell&#62;";<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; echo "&#60;cell&#62;". $row[creation_time]."&#60;/cell&#62;";<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; echo "&#60;cell&#62;". $row[call_type]."&#60;/cell&#62;";<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <br />echo "&#60;/row&#62;";<br />}<br />echo "&#60;/rows&#62;"; <br />?&#62;</p>
<p>can any one help me, where is the problem ?</p>
]]></description>
        	        	<pubDate>Wed, 09 Dec 2009 10:01:24 +0200</pubDate>
        </item>
</channel>
</rss>