Search Results

Search found 314 results on 13 pages for 'jqgrid'.

Page 2/13 | < Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • How to keep current selection for jqGrid pulldown edit

    - by WildBill
    When editing cells in jqGrid, specifically using a select pull-down to edit a cell, how does one make the current selection the current choice for that cell? In my page I have a cell where edittype:'select' is set but when one clicks on that row the value for that cells automatically changes to the first entry that my AJAX call returns. Is there something within JQGrid that needs to be set or does the object I send to jqGrid have to be of a certain format to do so?

    Read the article

  • jqGrid - dynamically load different drop down values for different rows depending on another column value

    - by Renso
    Goal: As we all know the jqGrid examples in the demo and the Wiki always refer to static values for drop down boxes. This of course is a personal preference but in dynamic design these values should be populated from the database/xml file, etc, ideally JSON formatted. Can you do this in jqGrid, yes, but with some custom coding which we will briefly show below (refer to some of my other blog entries for a more detailed discussion on this topic). What you CANNOT do in jqGrid, referrign here up and to version 3.8.x, is to load different drop down values for different rows in the jqGrid. Well, not without some trickery, which is what this discussion is about. Issue: Of course the issue is that jqGrid has been designed for high performance and thus I have no issue with them loading a  reference to a single drop down values list for every column. This way if you have 500 rows or one, each row only refers to a single list for that particuolar column. Nice! SO how easy would it be to simply traverse the grid once loaded on gridComplete or loadComplete and simply load the select tag's options from scratch, via ajax, from memory variable, hard coded etc? Impossible! Since their is no embedded SELECT tag within each cell containing the drop down values (remeber it only has a reference to that list in memory), all you will see when you inspect the cell prior to clicking on it, or even before and on beforeEditCell, is an empty <TD></TD>. When trying to load that list via a click event on that cell will temporarily load the list but jqGrid's last internal callback event will remove it and replace it with the old one, and you are back to square one. Solution: Yes, after spending a few hours on this found a solution to the problem that does not require any updates to jqGrid source code, thank GOD! Before we get into the coding details, the solution here can of course be customized to suite your specific needs, this one loads the entire drop down list that would be needed across all rows once into global variable. I then parse this object that contains all the properties I need to filter the rows depending on which ones I want the user to see based off of another cell value in that row. This only happens when clicking the cell, so no performance penalty. You may of course to load it via ajax when the user clicks the cell, but I found it more effecient to load the entire list as part of jqGrid's normal editoptions: { multiple: false, value: listingStatus } colModel options which again keeps only a reference to the sinlge list, no duplciation. Lets get into the meat and potatoes of it.         var acctId = $('#Id').val();         var data = $.ajax({ url: $('#ajaxGetAllMaterialsTrackingLookupDataUrl').val(), data: { accountId: acctId }, dataType: 'json', async: false, success: function(data, result) { if (!result) alert('Failure to retrieve the Alert related lookup data.'); } }).responseText;         var lookupData = eval('(' + data + ')');         var listingCategory = lookupData.ListingCategory;         var listingStatus = lookupData.ListingStatus;         var catList = '{';         $(lookupData.ListingCategory).each(function() {             catList += this.Id + ':"' + this.Name + '",';         });         catList += '}';         var lastsel;         var ignoreAlert = true;         $(item)         .jqGrid({             url: listURL,             postData: '',             datatype: "local",             colNames: ['Id', 'Name', 'Commission<br />Rep', 'Business<br />Group', 'Order<br />Date', 'Edit', 'TBD', 'Month', 'Year', 'Week', 'Product', 'Product<br />Type', 'Online/<br />Magazine', 'Materials', 'Special<br />Placement', 'Logo', 'Image', 'Text', 'Contact<br />Info', 'Everthing<br />In', 'Category', 'Status'],             colModel: [                 { name: 'Id', index: 'Id', hidden: true, hidedlg: true },                 { name: 'AccountName', index: 'AccountName', align: "left", resizable: true, search: true, width: 100 },                 { name: 'OnlineName', index: 'OnlineName', align: 'left', sortable: false, width: 80 },                 { name: 'ListingCategoryName', index: 'ListingCategoryName', width: 85, editable: true, hidden: false, edittype: "select", editoptions: { multiple: false, value: eval('(' + catList + ')') }, editrules: { required: false }, formatoptions: { disabled: false} }             ],             jsonReader: {                 root: "List",                 page: "CurrentPage",                 total: "TotalPages",                 records: "TotalRecords",                 userdata: "Errors",                 repeatitems: false,                 id: "0"             },             rowNum: $rows,             rowList: [10, 20, 50, 200, 500, 1000, 2000],             imgpath: jQueryImageRoot,             pager: $(item + 'Pager'),             shrinkToFit: true,             width: 1455,             recordtext: 'Traffic lines',             sortname: 'OrderDate',             viewrecords: true,             sortorder: "asc",             altRows: true,             cellEdit: true,             cellsubmit: "remote",             cellurl: editURL + '?rows=' + $rows + '&page=1',             loadComplete: function() {               },             gridComplete: function() {             },             loadError: function(xhr, st, err) {             },             afterEditCell: function(rowid, cellname, value, iRow, iCol) {                 var select = $(item).find('td.edit-cell select');                 $(item).find('td.edit-cell select option').each(function() {                     var option = $(this);                     var optionId = $(this).val();                     $(lookupData.ListingCategory).each(function() {                         if (this.Id == optionId) {                                                       if (this.OnlineName != $(item).getCell(rowid, 'OnlineName')) {                                 option.remove();                                 return false;                             }                         }                     });                 });             },             search: true,             searchdata: {},             caption: "List of all Traffic lines",             editurl: editURL + '?rows=' + $rows + '&page=1',             hiddengrid: hideGrid   Here is the JSON data returned via the ajax call during the jqGrid function call above (NOTE it must be { async: false}: {"ListingCategory":[{"Id":29,"Name":"Document Imaging & Management","OnlineName":"RF Globalnet"} ,{"Id":1,"Name":"Ancillary Department Hardware","OnlineName":"Healthcare Technology Online"} ,{"Id":2,"Name":"Asset Tracking","OnlineName":"Healthcare Technology Online"} ,{"Id":3,"Name":"Asset Tracking","OnlineName":"Healthcare Technology Online"} ,{"Id":4,"Name":"Asset Tracking","OnlineName":"Healthcare Technology Online"} ,{"Id":5,"Name":"Document Imaging & Management","OnlineName":"Healthcare Technology Online"} ,{"Id":6,"Name":"Document Imaging & Management","OnlineName":"Healthcare Technology Online"} ,{"Id":7,"Name":"EMR/EHR Software","OnlineName":"Healthcare Technology Online"}]} I only need the Id and Name for the drop down list, but the third column in the JSON object is important, it is the only that I match up with the OnlineName in the jqGrid column, and then in the loop during afterEditCell simply remove the ones I don't want the user to see. That's it!

    Read the article

  • jqgrid sample using array data, what am I missing

    - by Dennis
    Hello. I'm new in jqgrid, I'm just trying thes example to work. I have a html file only, nothing more. When I ran this file, array data is not showing. What am I missing here? Thanks in advance. <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>jqGrid Demos</title> <link rel="stylesheet" type="text/css" media="screen" href="lib/jquery-ui-1.7.1.custom.css" /> <link rel="stylesheet" type="text/css" media="screen" href="lib/ui.jqgrid.css" /> <link rel="stylesheet" type="text/css" media="screen" href="lib/ui.multiselect.css" /> <style type="text/css"> html, body { margin: 0; /* Remove body margin/padding */ padding: 0; overflow: hidden; /* Remove scroll bars on browser window */ font-size: 75%; } /*Splitter style */ #LeftPane { /* optional, initial splitbar position */ overflow: auto; } /* * Right-side element of the splitter. */ #RightPane { padding: 2px; overflow: auto; } .ui-tabs-nav li {position: relative;} .ui-tabs-selected a span {padding-right: 10px;} .ui-tabs-close {display: none;position: absolute;top: 3px;right: 0px;z-index: 800;width: 16px;height: 14px;font-size: 10px; font-style: normal;cursor: pointer;} .ui-tabs-selected .ui-tabs-close {display: block;} .ui-layout-west .ui-jqgrid tr.jqgrow td { border-bottom: 0px none;} .ui-datepicker {z-index:1200;} </style> <script src="lib/jquery-1.4.2.js" type="text/javascript"></script> <script src="lib/jquery-ui-1.7.2.custom.min.js" type="text/javascript"></script> <script src="lib/jquery.layout.js" type="text/javascript"></script> <script src="lib/grid.locale-en.js" type="text/javascript"></script> <script src="lib/jquery.jqGrid.min.js" type="text/javascript"></script> <script src="lib/jquery.tablednd.js" type="text/javascript"></script> <script src="lib/jquery.contextmenu.js" type="text/javascript"></script> <script src="lib/ui.multiselect.js" type="text/javascript"></script> <script type="text/javascript"> // We use a document ready jquery function. jQuery(document).ready(function(){ jQuery("#list").jqGrid({ datatype: "local", height: 250, colNames:['Inv No','Date', 'Client', 'Amount','Tax','Total', 'Notes'], colModel:[ {name:'id',index:'id', width:60, sorttype:"int"}, {name:'invdate',index:'invdate', width:90, sorttype:"date"}, {name:'name',index:'name', width:100}, {name:'amount',index:'amount', width:80, align:"right",sorttype:"float"}, {name:'tax',index:'tax', width:80, align:"right",sorttype:"float"}, {name:'total',index:'total', width:80,align:"right",sorttype:"float"}, {name:'note',index:'note', width:150, sortable:false} ], pager: '#pager', rowNum:10, rowList:[10,20,30], sortname: 'id', sortorder: 'desc', viewrecords: true, multiselect: true, imgpath: "lib/basic/images", caption: "Manipulating Array Data" }); }); var mydata = [ {id:"1",invdate:"2007-10-01",name:"test",note:"note",amount:"200.00",tax:"10.00",total:"210.00"}, {id:"2",invdate:"2007-10-02",name:"test2",note:"note2",amount:"300.00",tax:"20.00",total:"320.00"}, {id:"3",invdate:"2007-09-01",name:"test3",note:"note3",amount:"400.00",tax:"30.00",total:"430.00"}, {id:"4",invdate:"2007-10-04",name:"test",note:"note",amount:"200.00",tax:"10.00",total:"210.00"}, {id:"5",invdate:"2007-10-05",name:"test2",note:"note2",amount:"300.00",tax:"20.00",total:"320.00"}, {id:"6",invdate:"2007-09-06",name:"test3",note:"note3",amount:"400.00",tax:"30.00",total:"430.00"}, {id:"7",invdate:"2007-10-04",name:"test",note:"note",amount:"200.00",tax:"10.00",total:"210.00"}, {id:"8",invdate:"2007-10-03",name:"test2",note:"note2",amount:"300.00",tax:"20.00",total:"320.00"}, {id:"9",invdate:"2007-09-01",name:"test3",note:"note3",amount:"400.00",tax:"30.00",total:"430.00"} ]; for(var i=0;i<=mydata.length;i++) jQuery("#list").jqGrid('addRowData',i + 1, mydata1[i]); </script> </head> <body> <table id="list" class="scroll"></table> <div id="pager" class="scroll" style="text-align:center;"></div> </body>

    Read the article

  • jqGrid Export to CSV Missing Column Names

    - by user561557
    I have a jqGrid that works perfectly. It contains a pager button to export the grid to a csv file which works and exports the data. However, I also need to have the column names exported with the data and I can't seem to get that to work. My working code follows. jQuery("#detail").jqGrid('navGrid','#pager2', {height:520,width:500,savekey:[true,13],navkeys:[true,38,40],reloadAfterSubmit:false, jqModal:false, closeOnEscape:true, bottominfo:"Fields marked with () are required"}, // edit options {height:520, width:500,savekey:[true,13],reloadAfterSubmit:false,jqModal:false, closeOnEscape:true,bottominfo:"Fields marked with () are required", closeAfterAdd: true}, // add options {reloadAfterSubmit:false,jqModal:false, closeOnEscape:true}, // del options {closeOnEscape:true}, // search options {height:250,width:500,jqModal:false,closeOnEscape:true}, {view:true} // view options ); // add custom button to export the data to excel jQuery("#detail").jqGrid('navButtonAdd','#pager2',{ caption:"", title:"Export to CSV", onClickButton : function () { exportExcel(); }, position:"last" }); // add custom button to print grid jQuery("#detail").jqGrid('navButtonAdd','#pager2',{ caption:"", title:"Print", buttonicon:"ui-icon-print", onClickButton : function () { jQuery('#detail_table').jqprint({ operaSupport: true }); return false; } }); function exportExcel() { var mya=new Array(); mya=jQuery("#detail").getDataIDs(); // Get All IDs var data=jQuery("#detail").getRowData(mya[0]); // Get First row to get the labels var colNames=new Array(); var ii=0; for (var i in data){colNames[ii++]=i;} // capture col names var html=""; for(i=0;i } html=html+"\\n"; // end of line at the end document.forms[0].method='POST'; document.forms[0].action='ajax/csvExport.php'; // send it to server which will open this contents in excel file document.forms[0].target='_blank'; document.forms[0].csvBuffer.value=html; document.forms[0].submit(); }

    Read the article

  • jqGrid disable sortablerows

    - by gurun8
    I'm trying to disable sortablerows functionality from a grid. I'd like to have the ability to toggle on/off the sortablerows functionality. Enabling the feature is pretty straightforward: jQuery("#list").jqGrid('sortableRows', { update: function(event, ui) { updateOrder() } }); But disabling the feature has proven to be a little bit harder. I've consulted the UI Integrations where sortableRows is documented in the jqGrid Wiki: www.trirand.com/jqgridwiki/doku.php?id=wiki:jquery_ui_methods And found that "The method is fully compatible with jQuery UI sortable widget." So I ventured off to the jQuery UI sortable documentation and found this: http://jqueryui.com/demos/sortable/ jQuery("#list").jqGrid('sortableRows', {disabled: true}); The code above simply disables the rows. So I moved onto the destroy method: jQuery("#list").jqGrid('sortableRows', {destroy: true}); but that doesn't do anything. Based upon the documentation the destroy method seems to be exactly what I need, so maybe my syntax is wrong but I can't seem to get it to work. Does anyone have experience with this same issue?

    Read the article

  • JQGRID inline dropdown binding via AJAX

    - by Frank
    jQuery(document).ready(function () { var grid = $("#list"); var AllCategory={"1":"Computing","2":"Cooking","10":"Fiction","3":"Finance","6":"Language","4":"Medical","11":"News","8":"Philosophy","9":"Religion","7":"Sport","5":"Travel"}; grid.jqGrid({ url: '/SupplierOrder/Select_SupplierOrderDetailByX/', editurl: "clientArray", datatype: 'json', mtype: 'GET', colNames: ['Category', 'Qty'], colModel: [ { name: 'Category', index: 'CategoryID', align: 'left', editable: true, edittype: "select", formatter: 'select', editoptions: { value: AllCategory }, editrules: { required: true } }, { name: 'Qty', index: 'Qty', width: 40, align: 'left', editable: true, edittype: "text", editoptions: { size: "35", maxlength: "50"} } ], pager: jQuery('#pager'), rowNum: 10, rowList: [5, 10, 20, 50], sortname: '', sortorder: '', viewrecords: true, autowidth: true, autoheight: true, imgpath: '/scripts/themes/black-tie/images', caption: 'Supplier Order Detail' }) grid.jqGrid('navGrid', '#pager', { edit: false, add: false, del: true, refresh: false, search: false }, {}, {}, {}, {}); grid.jqGrid('inlineNav', '#pager', { addtext: "Add", edittext: "Edit", savetext: "Save", canceltext: "Cancel" }); }); It is my JQGrid. Then, I remove below code ... var AllCategory={"1":"Computing","2":"Cooking","10":"Fiction","3":"Finance","6":"Language","4":"Medical","11":"News","8":"Philosophy","9":"Religion","7":"Sport","5":"Travel"}; Replace with below code so that i can get dynamic data ... var AllCategory = (function () { var list = null; $.ajax({ async: false, global: false, type: "POST", url: 'Category_Lookup', dataType: 'json', data: {}, success: function (response, textStatus, jqXHR) { list = response; }, error: function (jqXHR, textStatus, errorThrown) { alert("jqXHR.responseText --> " + jqXHR.responseText + "\njqXHR --> " + jqXHR + "\ntextStatus --> " + textStatus + " \nerrorThrown --> " + errorThrown); } }); alert(list); return list; })(); Firstly, I get below message box ... Then I get Error Could anyone please tell me how to make it correct ? Every suggestion will be appreciated.

    Read the article

  • jqGrid - edit function never getting called

    - by dcp
    I'm having a problem with JQGrid using ASP.NET MVC. I'm trying to follow this example (after you go to that link, over on the left side of the page please click Live Data Manipulation, then Edit Row), but my edit function is never getting called (i.e. it's never getting into the $("#bedata").click(function(). Does anyone know what could be the problem? <script type="text/javascript"> var lastsel2; jQuery(document).ready(function() { jQuery("#editgrid").jqGrid({ url: '/Home/GetMovieData/', datatype: 'json', mtype: 'GET', colNames: ['id', 'Movie Name', 'Directed By', 'Release Date', 'IMDB Rating', 'Plot', 'ImageURL'], colModel: [ { name: 'id', index: 'Id', width: 55, sortable: false, hidden: true, editable: false, editoptions: { readonly: true, size: 10} }, { name: 'Movie Name', index: 'Name', width: 250, editable: true, editoptions: { size: 10} }, { name: 'Directed By', index: 'Director', width: 250, align: 'right', editable: true, editoptions: { size: 10} }, { name: 'Release Date', index: 'ReleaseDate', width: 100, align: 'right', editable: true, editoptions: { size: 10} }, { name: 'IMDB Rating', index: 'IMDBUserRating', width: 100, align: 'right', editable: true, editoptions: { size: 10} }, { name: 'Plot', index: 'Plot', width: 150, hidden: false, editable: true, editoptions: { size: 30} }, { name: 'ImageURL', index: 'ImageURL', width: 55, hidden: true, editable: false, editoptions: { readonly: true, size: 10} } ], pager: jQuery('#pager'), rowNum: 5, rowList: [5, 10, 20], sortname: 'id', sortorder: "desc", height: '100%', width: '100%', viewrecords: true, imgpath: '/Content/jqGridCss/redmond/images', caption: 'Movies from 2008', editurl: '/Home/EditMovieData/', caption: 'Movie List' }); }); $("#bedata").click(function() { var gr = jQuery("#editgrid").jqGrid('getGridParam', 'selrow'); if (gr != null) jQuery("#editgrid").jqGrid('editGridRow', gr, { height: 280, reloadAfterSubmit: false }); else alert("Hey dork, please select a row"); }); </script> The relevant HTML is here: <table id="editgrid"> </table> <div id="pager" style="text-align: center;"> </div> <input type="button" id="bedata" value="Edit Selected" />

    Read the article

  • JQuery jqGrid vertical spacing issue in IE

    - by JW
    I have been developing an app to use jQuery's jqGrid plugin, and I thought I had it all wrapped up until I tried to view the grid in IE. In IE, the grid appears with a much larger height in the .ui-jqgrid-view div, but the data itself stays at a smaller size and displays at the bottom of the container div (.ui-jqgrid-view). I need to get the grid to display "properly". I don't care if it is the larger size (that IE displays) or smaller (as in FF)... I just need to have the data fill the grid area. Thanks! I uploaded a screenshot: here Grid Code: $("#list").jqGrid({ url: gDataPath, datatype: 'json', mtype: 'GET', colNames: ['Id', 'VId', 'First Name', 'Last Name', 'MId'], colModel: [ { name: 'ID1', index: 'ID1', width: 75, align: 'left' }, { name: 'VID', index: 'VID', width: 75, align: 'left' }, { name: 'FirstName', index: 'FirstName', width: 225, align: 'left' }, { name: 'LastName', index: 'LastName', width: 225, align: 'left' }, { name: 'MIDno', index: 'MIDno', width: 260, align: 'left'}], pager: jQuery('#pager'), rowNum: 100, rowList: [50, 100, 200, 500], sortname: 'ID1', sortorder: "desc", viewrecords: true, imgpath: 'http://mysite/Content/images', caption: 'Project Name Data', ondblClickRow: function(rowid, iRow, iCol) { var i = jQuery("#list").getRowData(rowid); window.location = '<%=linkPath %>/'+ i.VisitID; } });

    Read the article

  • jQgrid Pagination with query string

    - by bsreekanth
    Hello, I recently started experimenting with jQgrid, and much appreciate for any guidance on the below use case. I need to implement a (advanced)search functionality, and the results are loaded in the jQgrid. When use pagination, how to specify a complex query in the post data? In the serverside (grails) it it represented as an object, which is mocked below class searchCommand { String val1 List<long> ids //from the multiple selection } the above members can be null, if the user doesn't select any. Without saving the state at the server, I guess the only way to make the pagination work is to pass the query object back and forth with the correct offset, index etc. if that is the case, how best to represent it in jQgrid side. I saw a parameter postData to set additional values, but not sure how to represnt the data (JSON??). Any code snippet on (retaining) converting it from the last result to postData would be helpful. thanks in advance.

    Read the article

  • jqgrid editoptions: required not functioning

    - by benpage
    ok not sure what i'm doing wrong here: $("#list").jqGrid({ url: --URL--, datatype: 'json', mtype: 'GET', colModel: [ { label: 'Index', index: 'Index', key: true, hidden: true }, { label: 'SampleSize', index: 'SampleSize', editable: true, editrules: { required: true, number: true} }, ], pager: '#pager', rowNum: 10, rowList: [10, 20, 30], viewrecords: true, height: 'auto', width: 'auto', editurl: '.', createurl: '.', deleteurl: '.' }); $('#list').jqGrid('navGrid', '#pager', { edit: true, add: true, del: true, search: false }, { url: '#' }, // edit options {url: '#' }, // add options {url: '#' }, // delete options {}, // search options {} ); when editing / creating a record, i can keep the textbox for 'samplesize' empty and jqgrid does not throw any kind of error. am i forgetting to add something in?

    Read the article

  • Jqgrid in a dialog window is not showing on the second calling

    - by Dennis
    I have this script below that will call my browse window; var $dialog = $('') .load('scripts/browsecharges.jsp') .dialog({ width: 800, height: 500, modal: false, title: 'Browse Charges', buttons: { Ok: function() { $(this).dialog('destroy'); } }, close: function(event, ui) { $(this).dialog('destroy').remove(); } }); $dialog.dialog('open'); This browse window contains a jqgrid in it. At first my jqgrid works fine, I can see the data. But calling this browse window for the second time, my jqgrid will not show anymore. What should I do to open it as many times as I want?

    Read the article

  • How to move row data from one jqgrid

    - by user1268130
    I am trying to move row from one grid to another grid.I am able to add the row to 2nd Grid but not able to delete row in the 1st grid. Here is my code: var RowList; RowList = $('#questions_list').getGridParam('selarrrow'); for (var i=0, list=RowList.length; i<list; i++) { var selectedId = RowList[i]; var selectedData = $('#questions_list').jqGrid('getRowData', selectedId ); $('#selectedQuestions_list').jqGrid('addRowData', selectedId , selectedData ); $('#questions_list').jqGrid('delRowData',selectedId ); } But I am not able to delete row properly,when I add delrowdata,I am not able to add properly.Can any one help me in the code.Thanks in Advance

    Read the article

  • jqGrid editForm problem

    - by PaulStanek
    Hi, I have simply jqgrid definitions like this: jQuery("#C2").jqGrid({ url: '/Customers.mvc/GetGridData/', datatype: 'json', autowidth: 'true', mtype: 'GET', colNames: ['Nazwa', 'Symbol', 'Status', 'Miasto', 'Ulica', 'Budynek', 'Mieszkanie', 'Koda pocztowy', 'Domena', ' '], colModel: [ { name: 'Name', index: 'Name', align: 'left', editable: 'true', edittype: 'text' }, { name: 'Symbol', index: 'Symbol', align: 'left', editable: 'true', edittype: 'text' }, { name: 'Status', index: 'Status', align: 'left', editable: 'true', edittype: 'text' }, { name: 'City', index: 'City', align: 'left', editable: 'true', edittype: 'text' }, { name: 'Street', index: 'Street', align: 'left', editable: 'true', edittype: 'text' }, { name: 'Building', index: 'Building', align: 'left', editable: 'true', edittype: 'text' }, { name: 'Flat', index: 'Flat', align: 'left', editable: 'true', edittype: 'text'}, { name: 'PostalCode', index: 'PostalCode', align: 'left', editable: 'true', edittype: 'text' }, { name: 'Domain', index: 'Domain', align: 'left', editable: 'true', edittype: 'text'}, { name: 'ExtId', index: 'ExtId', align: 'left', editable: 'true', edittype: 'text'}, ], pager: jQuery('#C2_p'), rowNum: 30, rowList: [20, 30, 50], sortname: 'Name', sortorder: 'Asc', viewrecords: 'true', width: '80%', height: '100%', editurl: '/Customers.mvc/SaveCustomer/', postData: { gridId: 'Customers' }, caption: 'Klienci2' }).navGrid('#C2_p', { edit: true, add: true, del: true, search: false, refresh: false }, {},//Options for the Edit Dialog {},//Options for the Add Dialog {}//Options for D ); }); And when i call edit/add form it's appears without text edit inputs. I'm using jquery 1.3.2 and jqgrid 3.6.4 Any help will be appreciated.

    Read the article

  • ASP .net MVC Jqgrid data binding

    - by SARAVAN
    Hi, I am using a jqgrid with a column named 'Comments'. My controller code returns data as follows: var jsonData = new { rows= .... .... select new { col1.... col2.... Comments = _Model.GetComments(id), }) ....... ..... return Json(jsonData, JsonRequestBehavior.AllowGet); } _Model.GetComments(id) will return a ClientComments Object which has a few properties say CommentID, FirstName, MiddleName etc., which will be bound to each row in the grid Now in my jqgrid I need to build a tool tip based on Comments column properties and for that I need to use the properties of my Comments in JQGrid for each row. May I know How I can manipulate Comment's properties for each row? Any help would be appreciated. I tried in my javascript that for each row rowObject.Comments.FirstName and it did not work.

    Read the article

  • Is Jquery $(this) broken by jqgrid gridunload method?

    - by chohi
    I expect the following code to unload a javascipt jqgrid, then load another grid with different options, including different columns //onload (function($) $.fn.myGridFn = function(options){ $(this).jqGrid('GridUnload'); $(this).jqGrid(options.gridoptions); //.... $('#select').change(function(){ switch($(this).val()) { case 'grid1': $('#grid').myGridFn({gridoptions:{/*grid1 options*/}}); break; case 'grid2': $('#grid').myGridFn({gridoptions:{/*grid2 options*/}}); break; } }); })(jQuery); //... <table id="grid"></table> What I get is the grid unloading, then I have to change the selection in the select element and back again to load the new grid. Updated: If I replace the $(this) in the plugin with the actual element selector $('#grid') - it works just fine, I cant do this in my real app because the plugin is used by several other table elements and grids

    Read the article

  • jqGrid Additional POST datas when deleting

    - by user300657
    I want to delete a row in the grid, but the grid always post's only the id and oper, I also want to post additional data. My jqgrid is something like : jQuery("#editgrid").jqGrid({ url:'autoJSON.php', datatype: "xml", colNames:['RowID','Asigurator','Cilindree','Persoana', 'Perioada', 'Pret'], colModel:[ {name:'rowID',index:'rowID', width:60, editable:true}, {name:'idAsigurator',index:'idAsigurator', width:100, editable:true,editoptions:{size:20}}, {name:'cilindree',index:'cilindree', width:90, editable:true,editoptions:{size:20}}, {name:'persoana',index:'persoana', width:300,editable:true,edittype:"select",editoptions:{value:"Persoana juridica:Persoana juridica;Pensionar:Pensionar;Persoana fizica:Persoana fizica"}}, {name:'perioada',index:'perioada', width:120, align:"right",edittype:"select",editable:true,editoptions:{value:"12 luni:12 luni;6 luni:6 luni"}}, {name:'pret',index:'pret', width:80, align:"right",editable:true,editoptions:{size:20}} ], width:900, height:600, pager: '#pagered', sortname: 'rowID', viewrecords: true, sortorder: "desc", caption:"Autoturisme", editurl:"autoPOST.php", }); jQuery("#editgrid").jqGrid('navGrid',"#pagered",{edit:true,add:true,del:true}); What should I do to access in autoPOST.php rowID also as a post variable. Thanks

    Read the article

  • JqGrid addJSONData + ASP.NET 2.0 WS

    - by MilosC
    Dear community ! I am a bit lost. I' ve tried to implement a solution based on JqGrid and tried to use function as datatype. I've setted all by the book i guess, i get WS invoked and get JASON back, I got succes on clientside in ajaf call and i "bind" jqGrid using addJSONData but grid remains empty. I do not have any glue now... other "local" samples on same pages works without a problem (jsonstring ...) My WS method looks like : [WebMethod] [ScriptMethod(ResponseFormat = ResponseFormat.Json)] public string GetGridData() { // Load a list InitSessionVariables(); SA.DB.DenarnaEnota.DenarnaEnotaDB db = new SAOP.SA.DB.DenarnaEnota.DenarnaEnotaDB(); DataSet ds = db.GetLookupForDenarnaEnota(SAOP.FW.DB.RecordStatus.All); // Turn into HTML friendly format GetGridData summaryList = new GetGridData(); summaryList.page = "1"; summaryList.total = "10"; summaryList.records = "160"; int i = 0; foreach (DataRow dr in ds.Tables[0].Rows) { GridRows row = new GridRows(); row.id = dr["DenarnaEnotaID"].ToString(); row.cell = "[" + "\"" + dr["DenarnaEnotaID"].ToString() + "\"" + "," + "\"" + dr["Kratica"].ToString() + "\"" + "," + "\"" + dr["Naziv"].ToString() + "\"" + "," + "\"" + dr["Sifra"].ToString() + "\"" + "]"; summaryList.rows.Add(row); } return JsonConvert.SerializeObject(summaryList); } my ASCX code is this: jQuery(document).ready(function(){ jQuery("#list").jqGrid({ datatype : function (postdata) { jQuery.ajax({ url:'../../AjaxWS/TemeljnicaEdit.asmx/GetGridData', data:'{}', dataType:'json', type: 'POST', contentType: "application/json; charset=utf-8", complete: function(jsondata,stat){ if(stat=="success") { var clearJson = jsondata.responseText; var thegrid = jQuery("#list")[0]; var myjsongrid = eval('('+clearJson+')'); alfs thegrid.addJSONData(myjsongrid.replace(/\\/g,'')); } } } ); }, colNames:['DenarnaEnotaID','Kratica', 'Sifra', 'Naziv'], colModel:[ {name:'DenarnaEnotaID',index:'DenarnaEnotaID', width:100}, {name:'Kratica',index:'Kratica', width:100}, {name:'Sifra',index:'Sifra', width:100}, {name:'Naziv',index:'Naziv', width:100}], rowNum:15, rowList:[15,30,100], pager: jQuery('#pager'), sortname: 'id', // loadtext:"Nalagam zapise...", // viewrecords: true, sortorder: "desc", // caption:"Vrstice", // width:"800", imgpath: "../Scripts/JGrid/themes/basic/images"}); }); from WS i GET JSON like this: {”page”:”1?,”total”:”10?,”records”:”160?,”rows”:[{"id":"18","cell":"["18","BAM","Konvertibilna marka","977"]“},{”id”:”19?,”cell”:”["19","RSD","Srbski dinar","941"]“},{”id”:”20?,”cell”:”["20","AFN","Afgani","971"]“},{”id”:”21?,”cell”:”["21","ALL","Lek","008"]“},{”id”:”22?,”cell”:”["22","DZD","Alžirski dinar","012"]“},{”id”:”23?,”cell”:”["23","AOA","Kvanza","973"]“},{”id”:”24?,”cell”:”["24","XCD","Vzhodnokaribski dolar","951"]“},{”id”:”25?,”cell”:” ……………… ["13","PLN","Poljski zlot","985"]“},{”id”:”14?,”cell”:”["14","SEK","Švedska krona","752"]“},{”id”:”15?,”cell”:”["15","SKK","Slovaška krona","703"]“},{”id”:”16?,”cell”:”["16","USD","Ameriški dolar","840"]“},{”id”:”17?,”cell”:”["17","XXX","Nobena valuta","000"]“},{”id”:”1?,”cell”:”["1","SIT","Slovenski tolar","705"]“}]} i have registered this js : clientSideScripts.RegisterClientScriptFile("prototype.js", CommonFunctions.FixupUrlWithoutSessionID("~/WebUI/Scripts/prototype-1.6.0.2.js")); clientSideScripts.RegisterClientScriptFile("jquery.js", CommonFunctions.FixupUrlWithoutSessionID("~/WebUI/Scripts/JGrid/jquery.js")); clientSideScripts.RegisterClientScriptFile("jquery.jqGrid.js", CommonFunctions.FixupUrlWithoutSessionID("~/WebUI/Scripts/JGrid/jquery.jqGrid.js")); clientSideScripts.RegisterClientScriptFile("jqModal.js", CommonFunctions.FixupUrlWithoutSessionID("~/WebUI/Scripts/JGrid/js/jqModal.js")); clientSideScripts.RegisterClientScriptFile("jqDnR.js", CommonFunctions.FixupUrlWithoutSessionID("~/WebUI/Scripts/JGrid/js/jqDnR.js")); Basical i think it must be something stupid ...but i can figure it out now... Help wanted.

    Read the article

  • Jqgrid set cell background color

    - by sachin
    In "Custom data tooltips in jqGrid 3.4" discussion, came to know how to use setcell to change the color of the text inside a cell of jqgrid. How can we change the background color of the cell? Tried the following jQuery("#list").setCell (row,col,'',{ background-color:'red'}) jQuery("#list").setCell (row,col,'','',{ bgcolor:'red'} Thanks.

    Read the article

  • jqGrid multi-checkbox custom edittype solution

    - by gsiler
    For those of you trying to understand jqGrid custom edit types ... I created a multi-checkbox form element, and thought I'd share. This was built using version 3.6.4. If anyone has a more efficient solution, please pass it on. Within the colModel, the appropriate edit fields look like this: edittype:'custom' editoptions:{ custom_element:MultiCheckElem, custom_value:MultiCheckVal, list:'Check1,Check2,Check3,Check4' } Here are the javascript functions (BTW, It also works – with some modifications – when the list of checkboxes is in a DIV block): //———————————————————— // Description: // MultiCheckElem is the "custom_element" function that builds the custom multiple check box input // element. From what I have gathered, jqGrid calls this the first time the form is launched. After // that, only the "custom_value" function is called. // // The full list of checkboxes is in the jqGrid "editoptions" section "list" tag (in the options // parameter). //———————————————————— function MultiCheckElem( value, options ) { //———- // for each checkbox in the list // build the input element // set the initial "checked" status // endfor //———- var ctl = ''; var ckboxAry = options.list.split(','); for ( var i in ckboxAry ) { var item = ckboxAry[i]; ctl += '<input type="checkbox" '; if ( value.indexOf(item + '|') != -1 ) ctl += 'checked="checked" '; ctl += 'value="' + item + '"> ' + item + '</input><br />&nbsp;'; } ctl = ctl.replace( /<br />&nbsp;$/, '' ); return ctl; } //———————————————————— // Description: // MultiCheckVal is the "custom_value" function for the custom multiple check box input element. It // appears that jqGrid invokes this function the first time the form is submitted and, the rest of // the time, when the form is launched (action = set) and when it is submitted (action = 'get'). //———————————————————— function MultiCheckVal(elem, action, val) { var items = ''; if (action == 'get') // the form has been submitted { //———- // for each input element // if it's checked, add it to the list of items // endfor //———- for (var i in elem) { if (elem[i].tagName == 'INPUT' && elem[i].checked ) items += elem[i].value + ','; } // items contains a comma delimited list that is returned as the result of the element items = items.replace(/,$/, ''); } else // the form is launched { //———- // for each input element // based on the input value, set the checked status // endfor //———- for (var i in elem) { if (elem[i].tagName == 'INPUT') { if (val.indexOf(elem[i].value + '|') == -1) elem[i].checked = false; else elem[i].checked = true; } } // endfor } return items; }

    Read the article

  • jqGrid tableToGrid "options" parameter

    - by Jimbo
    Basics Hi all, I have see the tableToGrid method (by Peter Romianowski) defined as tableToGrid(selector, options) on the jqGrid wiki, but cannot find anywhere that has documentation of the options Does anyone know about these or where to find them? More What Im actually trying to do is encase the resulting jqGrid in a form, which will submit the checkbox values that are in a column of the table. My problem is that the tableToGrid method appears to be removing the name property from the checkbox elements and hence they are not being submitted with the form post.

    Read the article

  • JQGrid tree - passing additional parameters when tree is expanded

    - by PHP thinker
    I have a JQGRid tree. It loads data click by click, not all at once. Typically, JQGRid passes 4 standard tree parameters with each call - row (level, parent, is leaf, is expanded). How can I pass more parameters that I will take from the row being expanded? E.g. data from Name column should be passed in AJAX call too. There doesn't seem to be OnExpand event or similar.

    Read the article

  • How to implement wordwrap on jqGrid which works on IE7, IE8 and FF

    - by Brandon
    How to implement wordwrap on jqGrid which works on IE7, IE8 and FF, while also having column-resize work (grid aligns correctly). Tried to innerwrap content on each td with a div of specific width (based on initial TH width), but colresize will not work on the divs I've inserted. jqGrid calculates the widths of the resized TH and adjacent THs though. Is there a better solution which will avoid all the JavaScript 'hacks'?

    Read the article

  • jqgrid problem:Where is the "filter" param?

    - by davykiash
    Am curently looking at the jqgrid documentation on advanced search and specifically search_adv.php file that comes with it. I have noted the following line of code $searchstr = Strip($_REQUEST['filters']); However when I look at the output on firebug of my jqgrid post I see _search true nd 1270148130165 page 1 rows 10 searchField income_types_desc searchOper eq searchString 5 sidx income_types_desc sord asc Where on earth is the "filter" param?

    Read the article

  • How to get a cell value in JQGrid?

    - by dev
    How to get a cell value in JQGrid? If I use the following syntax – var ret = jQuery("#MyGrid").jqGrid('getRowData', id); ret = ret.ProductId; it returns the following HTML. I actually need the value of the cell. Thanks. Dev

    Read the article

  • jQuery Validation plugin with JQGrid?

    - by Herb Caudill
    Has anyone successfully used the jQuery Validation plugin with JQGrid? I realize that JQGrid has its own validation scheme, but it's limited and a little clumsy; and I'd prefer to reuse the validation UI, language, and rules that I'm using with the rest of my forms.

    Read the article

< Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >