Search Results

Search found 340 results on 14 pages for 'sortable'.

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

  • Have trouble when using heredoc syntax in PHP

    - by wamp
    <?php $output = <<< END <table style="display: table;" class="listview rowstyle-rowhighlight" id="resourcegrid"> <thead> <tr> <th width="70"></th> <th style="-moz-user-select: none;" class="sortable fd-column-0"><a class="fdTableSortTrigger" href="#">Name</a></th> <th style="-moz-user-select: none;" class="sortable fd-column-1"><a class="fdTableSortTrigger" href="#">Contributor</a></th> <th style="-moz-user-select: none;" class="sortable fd-column-3"><a class="fdTableSortTrigger" href="#">Modified</a></th> </tr> </thead><tbody> END; echo $output; When I run it reports : Parse error: parse error on line 2 But I don't see anything abnormal.

    Read the article

  • Using DisplayTag library, I want to have the currently selected row have a unique custom class using

    - by Mary
    I have been trying to figure out how to highlight the selected row in a table. In my jsp I have jsp scriplet that can get access to the id of the row the displaytag library is creating. I want to compare it to the the id of the current row selected by the user ${currentNoteId}. Right now if the row id = 849 (hardcoded) the class "currentClass" is added to just that row of the table. I need to change the 849 for the {$currentNoteId} and I don't know how to do it. I am using java, Spring MVC. The jsp: ... <% request.setAttribute("dyndecorator", new org.displaytag.decorator.TableDecorator() { public String addRowClass() { edu.ilstu.ais.advisorApps.business.Note row = (edu.ilstu.ais.advisorApps.business.Note)getCurrentRowObject(); String rowId = row.getId(); if ( rowId.equals("849") ) { return "currentClass"; } return null; } }); %> <c:set var="currentNoteId" value="${studentNotes.currentNote.id}"/> ... <display:table id="noteTable" name="${ studentNotes.studentList }" pagesize="20" requestURI="notesView.form.html" decorator="dyndecorator"> <display:column title="Select" class="yui-button-match" href="/notesView.form.html" paramId="note.id" paramProperty="id"> <input type="button" class="yui-button-match2" name="select" value="Select"/> </display:column> <display:column property="userName" title="Created By" sortable="true"/> <display:column property="createDate" title="Created On" sortable="true" format="{0,date,MM/dd/yy hh:mm:ss a}"/> <display:column property="detail" title="Detail" sortable="true"/> </display:table> ... This could also get done using javascript and that might be best, but the documentation suggested this so I thought I would try it. I cannot find an example anywhere using the addRowClass() unless the comparison is to a field already in the row (a dollar amount is used in the documentation example) or hardcoded in like the "849" id. Thanks for any help you can provide.

    Read the article

  • Binding elements when modal window loads from AJAX (jQuery)

    - by thinkswan
    I'd like to set up a drag'n'drop list inside a modal window. The window's content is loaded via an AJAX call, so I believe I need to use jQuery's .live() method. Here is my current code: $('#cboxLoadedContent').live('load', function() { // Event for sortable page lists $('ul#pageList').sortable(); }); How can I set up bindings when the modal window loads? The modal window comes from the colorbox plugin. Note: I'm guessing that 'load' is not the right event to use, because if I throw a simple alert() in there, it doesn't even show up when the window loads.

    Read the article

  • iframe as scriptaculous droppable

    - by Nathan
    I have a sortable list and an iframe on the same page. What I'm trying to do is define the <iframe> as a Droppable. Everything works with out errors but when I try to drag a sortable item across the Iframe it stops at the edge. ( if I move it slowly it seems works in firefox) The Iframe is set to DesignMode ="on" so covering it with a transparent element to act as the droppable does not seem applicable here. Anyone know of any other solutions or a better way to handle this?

    Read the article

  • How to get global variable in JQuery functions

    - by Tahir Akram
    I want to access my global javascript variable in JQuery methods. But I am unable to get it when I go to attach a click even to a div. As following. How can I do that? I mean do I need to rely on hidden fields for some state management? var divCount = 3; $(function() { //divCount is accessible here $("#sortable").sortable({ revert: true }); $("#new").click(function(){ if (divCount<7){ //divCount is not accessible here. why? and how? var thisCount = ++divCount; $("#draggable_"+thisCount).addClass("draggable"); } }); });

    Read the article

  • ExtJS Data Grid Column renderer to have multiple values

    - by Podlsk
    Hi, I am wondering if it is possible in ExtJS to have several values of the data source available to the renderer of the column. For example with the "Actions" column, the id is passed to the renderer. However I require both the user_id and id passed to the render. How may I do this? table_cols = [{ header: "User ID", width: 30, sortable: true, dataIndex: 'user_id' }, { header: "Actions", width: 60, sortable: false, dataIndex: 'id', renderer: function(val) { //IF USER ID MEETS A CONSTRAINT PRINT THE ID } }]; Thanks.

    Read the article

  • Are Sphinx & thinking_sphinx really stable? Not indexing Columns

    - by seb
    I'm encountering strange behaviour from thinking_sphinx/sphinx. My define_index block is about 100 lines, so quite a lot of columns i'm indexing. For full-text searching I only need about 10 attributes, for sorting and filtering I have another approximately 50 columns, mostly floats and integers. By filtering I mean using the "with" or "without" options. Searching does not really work consistently. All of a sudden, one attribute fails to filter. Or if I add a new one, it does not work. Only after a lot of tinkering it suddenly starts working. I cannot really reproduce it. Steps I that sometimes lead me to success where: rm -rf db/sphinx change the attribute definition e.g. has some_attribute = has some_attribute, :sortable = true or = has some_attribute, :sortable = true, :as = "some_attribute" restarting the server assigning a new :as name = has some_attribute, :as = "some_attribute_new" (yes, I did rake ts:rebuild or rake ts:in after every step) Does anybody else encounter similar problems?

    Read the article

  • Querying and ordering results of a database in grails using transient fields

    - by Azder
    I'm trying to display paged data out of a grails domain object. For example: I have a domain object Employee with the properties firstName and lastName which are transient, and when invoking their setter/getter methods they encrypt/decrypt the data. The data is saved in the database in encrypted binary format, thus not sortable by those fields. And yet again, not sortable by transient ones either, as noted in: http://www.grails.org/GSP+Tag+-+sortableColumn . So now I'm trying to find a way to use the transients in a way similar to: Employee.withCriteria( max: 10, offset: 30 ){ order 'lastName', 'asc' order 'firstName', 'asc' } The class is: class Employee { byte[] encryptedFirstName byte[] encryptedLastName static transients = [ 'firstName', 'lastName' ] String getFirstName(){ decrypt("encryptedFirstName") } void setFirstName(String item){ encrypt("encryptedFirstName",item) } String getLastName(){ decrypt("encryptedLastName") } void setLastName(String item){ encrypt("encryptedLastName",item) } }

    Read the article

  • problem with JsonStore and JsonReader

    - by kalan
    Hello, In my ExtJS application I use EditorGridPanel to show data from server. var applicationsGrid = new Ext.grid.EditorGridPanel({ region: 'west', layout: 'fit', title: '<img src="../../Content/img/app.png" /> ??????????', collapsible: true, margins: '0 0 5 5', split: true, width: '30%', listeners: { 'viewready': { fn: function() { applicationsGridStatusBar.setText('??????????: ' + applicationsStore.getTotalCount()); } } }, store: applicationsStore, loadMask: { msg: '????????...' }, sm: new Ext.grid.RowSelectionModel({ singleSelect: true, listeners: { 'rowselect': { fn: applicationsGrid_onRowSelect} } }), viewConfig: { forceFit: true }, tbar: [{ icon: '../../Content/img/add.gif', text: '????????' }, '-', { icon: '../../Content/img/delete.gif', text: '???????' }, '-'], bbar: applicationsGridStatusBar, columns: [{ header: '??????????', dataIndex: 'ApplicationName', tooltip: '???????????? ??????????', sortable: true, editor: { xtype: 'textfield', allowBlank: false } }, { header: '<img src="../../Content/img/user.png" />', dataIndex: 'UsersCount', align: 'center', fixed: true, width: 50, tooltip: '?????????? ????????????? ??????????', sortable: true }, { header: '<img src="../../Content/img/role.gif" />', dataIndex: 'RolesCount', align: 'center', fixed: true, width: 50, tooltip: '?????????? ????? ??????????', sortable: true}] }); When I use JsonStore without reader it works, but when I try to update any field it uses my 'create' url instead of 'update'. var applicationsStore = new Ext.data.JsonStore({ root: 'applications', totalProperty: 'total', idProperty: 'ApplicationId', messageProperty: 'message', fields: [{ name: 'ApplicationId' }, { name: 'ApplicationName', allowBlank: false }, { name: 'UsersCount', allowBlank: false }, { name: 'RolesCount', allowBlank: false}], id: 'app1234', proxy: new Ext.data.HttpProxy({ api: { create: '/api/applications/getapplicationslist1', read: '/api/applications/getapplicationslist', update: '/api/applications/getapplicationslist2', destroy: '/api/applications/getapplicationslist3' } }), autoSave: true, autoLoad: true, writer: new Ext.data.JsonWriter({ encode: false, listful: false, writeAllFields: false }) }); I believe that the problem is that I don't use reader, but when I use JsonReader grid stops showing any data at all. var applicationReader = new Ext.data.JsonReader({ root: 'applications', totalProperty: 'total', idProperty: 'ApplicationId', messageProperty: 'message', fields: [{ name: 'ApplicationId' }, { name: 'ApplicationName', allowBlank: false }, { name: 'UsersCount', allowBlank: false }, { name: 'RolesCount', allowBlank: false}] }); var applicationsStore = new Ext.data.JsonStore({ id: 'app1234', proxy: new Ext.data.HttpProxy({ api: { create: '/api/applications/getapplicationslist1', read: '/api/applications/getapplicationslist', update: '/api/applications/getapplicationslist2', destroy: '/api/applications/getapplicationslist3' } }), reader: applicationReader, autoSave: true, autoLoad: true, writer: new Ext.data.JsonWriter({ encode: false, listful: false, writeAllFields: false }) }); So, does anyone know what the problem might be and how to solve it. The data returned from my server is Json-formated and seams to be ok {"message":"test","total":2,"applications":[{"ApplicationId":"f82dc920-17e7-45b5-98ab-03416fdf52b2","ApplicationName":"Archivist","UsersCount":6,"RolesCount":3},{"ApplicationId":"054e2e78-e15f-4609-a9b2-81c04aa570c8","ApplicationName":"Test","UsersCount":1,"RolesCount":0}]}

    Read the article

  • What marketplace / garage-sale software package does togoparts.com use?

    - by gus
    See: OpenSource Marketplace Platform I want to start a site also for end-users to buy/sell used sporting goods of a particular type. When the scope of goods is narrowed like this, it is very advantageous to be able to filter by Brand, Size, Price Range, etc. Nice features: account reputation with user comments listings sortable by many custom fields auto resize and recompress image uploads I don't want to reinvent the wheel, so does anyone know where I can start?

    Read the article

  • jQuery / jqGrids / Submitting form data troubles...

    - by Kelso
    Ive been messing with jqgrids alot of the last couple days, and I have nearly everything the way I want it from the display, tabs with different grids, etc. Im wanting to make use of Modal for adding and editing elements on my grid. My problem that Im running into is this. I have my editurl:"editsu.php" set, if that file is renamed, on edit, i get a 404 in the modal.. great! However, with that file in place, nothing at all seems to happen. I even put a die("testing"); line at the top, so it sees the file, it just doesnt do anything with it. Below is the content. ........ the index page jQuery("#landings").jqGrid({ url:'server.php?tid=1', datatype: "json", colNames:['ID','Tower','Sector', 'Client', 'VLAN','IP','DLink','ULink','Service','Lines','Freq','Radio','Serial','Mac'], colModel:[ {name:'id', index:'id', width : 50, align: 'center', sortable:true,editable:true,editoptions:{size:10}}, {name:'tower', index:'tower', width : 85, align: 'center', sortable:true,editable:false,editoptions:{readonly:true,size:30}}, {name:'sector', index:'sector', width : 50, align: 'center',sortable:true,editable:true,editoptions:{readonly:true,size:20}}, {name:'customer',index:'customer', width : 175, align: 'left', editable:true,editoptions:{readonly:true,size:35}}, {name:'vlan', index:'vlan', width : 35, align: 'left',editable:true,editoptions:{size:10}}, {name:'suip', index:'suip', width : 65, align: 'left',editable:true,editoptions:{size:20}}, {name:'datadl',index:'datadl', width:55, editable: true,edittype:"select",editoptions:{value:"<? $qr = qquery("select * from datatypes"); while ($q = ffetch($qr)) {echo "$q[id]:$q[name];";}?>"}}, {name:'dataul', index:'dataul', width : 55, editable: true,edittype:"select",editoptions:{value:"<? $qr = qquery("select * from datatypes"); while ($q = ffetch($qr)) {echo "$q[id]:$q[name];";}?>"}}, {name:'servicetype', index:'servicetype', width : 85, editable: true,edittype:"select",editoptions:{value:"<? $qr = qquery("select * from servicetype"); while ($q = ffetch($qr)) {echo "$q[id]:$q[name];";}?>"}}, {name:'voicelines', index:'voicelines', width : 35, align: 'center',editable:true,editoptions:{size:30}}, {name:'freqname', index:'freqname', width : 35, editable: true,edittype:"select",editoptions:{value:"<? $qr = qquery("select * from freqband"); while ($q = ffetch($qr)) {echo "$q[id]:$q[name];";}?>"}}, {name:'radioname', index:'radioname', width : 120, editable: true,edittype:"select",editoptions:{value:"<? $qr = qquery("select * from radiotype"); while ($q = ffetch($qr)) {echo "$q[id]:$q[name];";}?>"}}, {name:'serial', index:'serial', width : 100, align: 'right',editable:true,editoptions:{size:20}}, {name:'mac', index:'mac', width : 120, align: 'right',editable:true,editoptions:{size:20}} ], rowNum:20, rowList:[30,50,70], pager: '#pagerl', sortname: 'sid', mtype: "GET", viewrecords: true, sortorder: "asc", altRows: true, caption:"Landings", editurl:"editsu.php", height:420 }); jQuery("#landings").jqGrid('navGrid','#pagerl',{edit:true,add:true,del:false,search:false},{height:400,reloadAfterSubmit:false},{height:400,reloadAfterSubmit:false},{reloadAfterSubmit:false},{}); now for the editsu.php file.. $operation = $_REQUEST['oper']; if ($operation == "edit") { qquery("UPDATE customers SET vlan = '".$_POST['vlan']."', datadl = '".$_POST['datadl']."', dataul = '".$_POST['dataul']."', servicetype = '".$_POST['servicetype']."', voicelines = '".$_POST['voicelines']."', freqname = '".$_POST['freqname']."', radioname = '".$_POST['radioname']."', serial = '".$_POST['serial']."', mac = '".$_POST['mac']."' WHERE id = '".$_POST['id']."'") or die(mysql_error()); } Im just having a hard time troubleshooting this to figure out where its getting hung up at. My next question after this would be to see if its possible to make it so when you click "add", that it auto inserts a row into the db with a couple variable predtermined and then bring up the modal window, but ill work on the first problem first. thanks!

    Read the article

  • jqgrid retrieving empty rows using webapi (REST)

    - by polonskyg
    I'm using jqgrid in an ASPNET MVC4 project with WebApi (REST), Entity Framework 5 using Unit Of Work and Repository patterns. My problem is that I see the data flowing as json to the browser and I see three rows in the grid, but those rows are empty, and the data is not shown (three empty rows in the grid). This is method to get the data in the WebApi controller: public dynamic GetGridData(int rows, int page, string sidx, string sord) { var pageSize = rows; var index = sidx; var order = sord; var categories = Uow.Categories.GetAll().OrderBy(t => (string.IsNullOrEmpty(index) ? "Id" : index) + " " + (order ?? "desc")); var pageIndex = Convert.ToInt32(page) - 1; var totalRecords = categories.Count(); var totalPages = (int)Math.Ceiling((float) totalRecords / (float) pageSize); var categoriesPage = categories.Skip(pageIndex * pageSize).Take(pageSize).ToList(); return new { total = totalPages, page = page, records = totalRecords, rows = (from category in categoriesPage select new { id = category.Id.ToString(), cell = new string[] { category.Id.ToString(), category.Name, category.Description } }).ToArray() }; } This is the json received in the browser { "total": 1, "page": 1, "records": 3, "rows": [{ "id": "1", "cell": ["1", "Category 1", null] }, { "id": "3", "cell": ["3", "Category 3", "asAS"] }, { "id": "4", "cell": ["4", "Category 4", null] }] } This is the .js file with jqgrid jQuery("#ajaxGrid").jqGrid({ url: $("#ServiceUrl").val(), datatype: "json", jsonReader: { repeatitems: false, id: "Id" }, colNames: ['Id', 'Name', 'Description'], colModel: [ { name: 'id', editable: true, sortable: true, hidden: true, align: 'left' }, { name: 'name', editable: true, sortable: true, hidden: false, align: 'left' }, { name: 'description', editable: true, sortable: true, hidden: false, align: 'left' } ], mtype: 'GET', rowNum: 15, pager: '#ajaxGridPager', rowList: [10, 20, 50, 100], caption: 'List of Categories', imgpath: $("#ServiceImagesUrl").val(), altRows: true, shrinkToFit: true, viewrecords: true, autowidth: true, height: 'auto', error: function(x, e) { alert(x.readyState + " "+ x.status +" "+ e.msg); } }); function updateDialog(action) { return { url: $("#ServiceUrl").val(), closeAfterAdd: true, closeAfterEdit: true, afterShowForm: function (formId) { }, modal: true, onclickSubmit: function (params) { var list = $("#ajaxGrid"); var selectedRow = list.getGridParam("selrow"); params.url += "/" + list.getRowData(selectedRow).Id; params.mtype = action; }, width: "300", ajaxEditOptions: { contentType: "application/json" }, serializeEditData: function (data) { delete data.oper; return JSON.stringify(data); } }; } jQuery("#ajaxGrid").jqGrid( 'navGrid', '#ajaxGridPager', { add: true, edit: true, del: true, search: false, refresh: false }, updateDialog('PUT'), updateDialog('POST'), updateDialog('DELETE') ); BTW, If I want to return jqGridData instead the dynamic, How should I do it? Did is showing empty rows as well: public class jqGridData<T> where T : class { public int page { get; set; } public int records { get; set; } public IEnumerable<T> rows { get; set; } public decimal total { get; set; } } public jqGridData<Category> GetGridData(int rows, int page, string sidx, string sord) { var pageSize = rows; var index = sidx; var order = sord; var categories = Uow.Categories.GetAll().OrderBy(t => (string.IsNullOrEmpty(index) ? "Id" : index) + " " + (order ?? "desc")); var pageIndex = Convert.ToInt32(page) - 1; var totalRecords = categories.Count(); var totalPages = (int)Math.Ceiling((float)totalRecords / (float)pageSize); var categoriesPage = categories.Skip(pageIndex * pageSize).Take(pageSize); return new jqGridData<Category> { page = page, records = totalRecords, total = totalPages, rows = categoriesPage }; }

    Read the article

  • Why does jQuery's $().each() function seem to be losing track of the DOM?

    - by Nate Wagar
    I've recently started encountering a very strange problem. To be honest, I'm not entirely sure how to describe it other than to just show it. Here's the relevant HTML: <div class="component container w100 noEdit" id="contentWrapper"> <div class="component container w50" id="container1"> <div class="component text w50" id="text1"> Text1 </div> </div> <div class="component container w25" id="container2"> Container2 </div> <div class="component container w25" id="container3"> Container3 </div> <div class="component container w25" id="container4"> Container4 </div> </div> And the relevant JavaScript: $(document).ready(function () { //Add the Grab Bar to container components on the page. $('.component').each(wrapComponentForEdit); $('#contentWrapper').sortable(); $('#contentWrapper').disableSelection(); }); var wrapComponentForEdit = function() { if (!$(this).hasClass('noEdit')) { $(this).html('<div class="componentBorder">' + $(this).html() + '</div>'); $(this).prepend('<div class="grabBar_l"><div class="grabBar_r"><div class="grabBar"></div></div></div>'); alert($(this).attr('id')); } } The end result of this is that I see an alert pop up for container1, text1, container2, container3, container 4. And yet only the containers (not the text) end up with the visual changes that the $().each() is supposed to make. Anyone have any idea what the heck is going on? Thanks! EDIT - A different way to do it, that still fails I tried this, with the same result: $(document).ready(function () { //Add the Grab Bar to container components on the page. var matched = $('.component'); var componentCount = $(matched).size(); for (i = 0; i < componentCount; i++) { wrapComponentForEdit($(matched).eq(i)); } $('#contentWrapper').sortable({ handle: '.grabBarBit', tolerance: 'pointer'}); $('#contentWrapper').disableSelection(); }); var wrapComponentForEdit = function(component) { if (!$(component).hasClass('noEdit')) { $(component).html('<div class="grabBar_l grabBarBit"><div class="grabBar_r grabBarBit"><div class="grabBar grabBarBit"></div></div></div><div class="componentBorder">' + $(component).html() + '</div>'); alert($(component).attr('id')); } } EDIT 2: Another alternate method, but this one works I tried another way of doing things, and this way it works. However, the initial question still stands. Judging by how this new way works, it seems to me that the DOM is being updated, but jQuery isn't updating with it, so it loses track of the child element. $(document).ready(function () { //Add the Grab Bar to container components on the page. var componentCount = $('.component').size(); for (i = 0; i < componentCount; i++) { wrapComponentForEdit($('.component').eq(i)); } $('#contentWrapper').sortable({ handle: '.grabBarBit', tolerance: 'pointer'}); $('#contentWrapper').disableSelection(); }); var wrapComponentForEdit = function(component) { if (!$(component).hasClass('noEdit')) { $(component).html('<div class="grabBar_l grabBarBit"><div class="grabBar_r grabBarBit"><div class="grabBar grabBarBit"></div></div></div><div class="componentBorder">' + $(component).html() + '</div>'); alert($(component).attr('id')); } }

    Read the article

  • JqGrid Add custom button to Row

    - by oirfc
    Hi there, I am trying to add a custom button to a JqGrid that implements a 'Check Out' process. Basically, every row has a 'Check Out' button that if clicked should be able to send a post back to the server and update a shopping cart and then change the button text to 'Undo Check Out'. So far I have: colNames: ['Id', ... , 'Action' ], colModel: [ { name: 'Id', sortable: false, width: 1, hidden: true}, ... { name: 'action', index: 'action', width: 75, sortable: false } ], ... gridComplete: function() { var ids = jQuery("#east-grid").jqGrid('getDataIDs'); for (var i = 0; i < ids.length; i++) { var cl = ids[i]; checkout = "<input style='height:22px;width:75px;' type='button' value='Check Out' onclick=\" ??? \" />"; jQuery("#east-grid").jqGrid('setRowData', ids[i], { action: checkout }); } }, ... Where '???' is the part I need to solve. Thank you in advance for your help.

    Read the article

  • ExtJS: remove a grid from a tabpanel when its underlying store is empty

    - by Antonio
    Hi, I have TabPanel which contains, among other things, a Grid connected to a Store. Several events may remove elements from the store. I would like the Grid to be removed from the TabPanel when the store is empty and, possibly, to have a single place in my code to check for this event. I thought about using store listeners, but unfortunately this causes exceptions in Ext code. My assumption is that this happens because rendering is performed on the grid after this is removed from the tabpanel. Any idea on how to accomplish such a task without messing up Ext is much appreciated. Thanks :) By the way, this is a code excerpt: var myStore = new Ext.data.Store({ reader: new Ext.data.JsonReader({fields: MyRecord}), listeners:{ 'clear': function(store, recs) { myTabPanel.remove(myGrid); }, 'remove': function(store, rec, idx) { if (store.getCount() == 0) { myTabPanel.remove(myGrid); } } } }); var myGrid = new Ext.grid.GridPanel({ id: "myGrid", title: "A Grid", store: myStore, frame:false, border:false, columns: [ { header: 'Remove', align:'center', width: 45, sortable: false, renderer: function(value, metaData, record, rowIndex, colIndex, store) { return '<img src="images/remove.png" width="34" height="18"/>'; } },{ header: 'Some Data', dataIndex: 'data', sortable: true } ], listeners:{ 'cellclick':function(grid, rowIndex, colIndex, e){ var rec = myStore.getAt(rowIndex); if(colIndex == 0){ myStore.remove(rec); } } } }); var myTabPanel= new Ext.TabPanel({ activeTab: 0, items: [ fooPanel, barPanel, myGrid] });

    Read the article

  • Ext.data.Store, Javascript Arrays and Ext.grid.ColumnModel

    - by Michael Wales
    I am using Ext.data.Store to call a PHP script which returns a JSON response with some metadata about fields that will be used in a query (unique name, table, field, and user-friendly title). I then loop through each of the Ext.data.Record objects, placing the data I need into an array (this_column), push that array onto the end of another array (columns), and eventually pass this to an Ext.grid.ColumnModel object. The problem I am having is - no matter which query I am testing against (I have a number of them, varying in size and complexity), the columns array always works as expected up to columns[15]. At columns[16], all indexes from that point and previous are filled with the value of columns[15]. This behavior continues until the loop reaches the end of the Ext.data.Store object, when the entire arrays consists of the same value. Here's some code: columns = []; this_column = []; var MetaData = Ext.data.Record.create([ {name: 'id'}, {name: 'table'}, {name: 'field'}, {name: 'title'} ]); // Query the server for metadata for the query we're about to run metaDataStore = new Ext.data.Store({ autoLoad: true, reader: new Ext.data.JsonReader({ totalProperty: 'results', root: 'fields', id: 'id' }, MetaData), proxy: new Ext.data.HttpProxy({ url: 'index.php/' + type + '/' + slug }), listeners: { 'load': function () { metaDataStore.each(function(r) { this_column['id'] = r.data['id']; this_column['header'] = r.data['title']; this_column['sortable'] = true; this_column['dataIndex'] = r.data['table'] + '.' + r.data['field']; // This display valid information, through the entire process console.info(this_column['id'] + ' : ' + this_column['header'] + ' : ' + this_column['sortable'] + ' : ' + this_column['dataIndex']); columns.push(this_column); }); // This goes nuts at columns[15] console.info(columns); gridColModel = new Ext.grid.ColumnModel({ columns: columns });

    Read the article

  • Thinking Sphinx and acts_as_taggable_on plugin

    - by Brian Roisentul
    Hi, I installed Sphinx and Thinking Sphinx for ruby on rails 2.3.2. When I search without conditions search works ok. Now, what I'd like to do is filter by tags, so, as I'm using the acts_as_taggable_on plugin, my Announcement model looks like this: class Announcement < ActiveRecord::Base acts_as_taggable_on :tags,:category define_index do indexes title, :as => :title, :sortable => true indexes description, :as => :description, :sortable => true indexes tags.name, :as => :tags indexes category.name, :as => :category has category(:id), :as => :category_ids has tags(:id), :as => :tag_ids end For some reason, when I run the following command, it will bring just one announcement, that has nothing to do with what I expect. I've got many announcements, so I expected a lot of results instead. Announcement.search params[:announcement][:search].to_s, :with => {:tag_ids => 1}, :page => params[:page], :per_page => 10 I guess something is wrong, and it's not searching correctly. Can anyone give my a clue of what's going on? Thanks, Brian

    Read the article

  • YUI DataTable - Howto have just one paginator?

    - by Rollo Tomazzi
    Hello, I'm using the YUI DataTable in a Grails 1.1 project using the Grails UI plugin 1.0.2 (YUI being 2.6.1). By default, the DataTable displays 2 paginators: one above and another one below the table. Looking up the YUI API documentation, I could see that I can pass an array of YUI containers as a config parameter but - what are the names of these containers? I've tried loooking at the HTML of the page using Firebug. The ID of the divs containing the paginators are: yui-dt0-paginator0 (above) and yui-dt0-paginator1 (below). If I use them to configure the containers for the navigator, then the navigator is just not displayed at all. Here's the relevant extract of the GSP page containing the Datatable element. <div class="body"> <h1>This is the List of Control Accounts</h1> <g:if test="${flash.message}"> <div class="message">${flash.message}</div> </g:if> <div class="yui-skin-sam"> <gui:dataTable controller="controlAccount" action="enhancedListDataTableJSON" columnDefs="[ [key:'id', label:'ID'], [key:'col1', label:'Col 1', sortable: true, resizeable: true], [key:'col2', label:'Col 2', sortable: true, resizeable: true] ]" sortedBy="col1" rowsPerPage="20" paginatorConfig="[ template:'{PreviousPageLink} {PageLinks} {NextPageLink} {CurrentPageReport}', pageReportTemplate:'{totalRecords} total accounts', alwaysVisible:true, containers:'yui-dt0-paginator1' ]" rowExpansion="true" /> </div> </div> Any help? Thanks! Rollo

    Read the article

  • jQuery Datatables throws error when dynamically created row headers

    - by JM4
    I am using the Datatables jquery plugin for one of my projects. For one in particular, the number of columns can vary based on how many children a consumer has (yes I realize normalization and proper technique would insert on another row but it is a client requirement). Datatables must be set up as such: <table> <thead> <tr> <th></th> </tr> </thead> <tbody> <tr> <td></td> </tr> </tbody> </table> my script starts out as: <table cellpadding="0" cellspacing="0" border="0" class="display" id="sortable"> <thead> <tr> <th>parent name</th> <th>parent phone</th> <?php try { $db->beginTransaction(); $stmt = $db->prepare("SELECT max(num_deps) FROM (SELECT count(a.id) as num_deps FROM children a INNER JOIN parents b USING(id) WHERE a.id !=0 GROUP BY a.id) x"); $stmt->execute(); $rows = $stmt->fetchAll(); for($i=1; $i<=$rows[0][0]; $i++) { echo " <th>Child Name ".$i."</th> <th>Date of Birth ".$i."</th> "; } $db->commit(); } catch (PDOException $e) { echo "<p align='center'>There was a system error. Please contact administration.<br>".$e->getMessage()."</p><br />"; } ?> </tr> </thead> In this manner, the final column headers can be 1 or 50 spots long. However, with this dynamic code in place, datatables throws the following error: ""DataTables warning (table id = 'datatable'): Cannot reinitialise DataTable. To retrieve the DataTables object for this table, please pass either no arguments to the dataTable() function, or set bRetrive to true. Alternativly, to destroy old table and create a new one...ETC."' Yes I have set "bRetrieve" : true in the javascript above and that does not do the trick. If I remove the code above, the file "works" fine but it leaves off the necessary columns for my table. Any ideas? Displaying JS <script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jqueryui/1.8.6/jquery-ui.min.js"></script> <script type="text/javascript" src="../media/js/jquery.dataTables.min.js"></script> <script type="text/javascript" src="../media/js/TableTools/TableTools.js"></script> <script type="text/javascript" src="../media/ZeroClipboard/ZeroClipboard.js"></script> <script type="text/javascript"> $(document).ready(function() { TableToolsInit.sSwfPath = "../media/swf/ZeroClipboard.swf"; oTable = $('#sortable').dataTable({ "bRetrieve": true, "bProcessing": true, "sScrollX": "100%", "sScrollXInner": "110%", "bScrollCollapse": true, "bJQueryUI": true, "sPaginationType": "full_numbers", "sDom": 'T<"clear"><"fg-toolbar ui-widget-header ui-corner-tl ui-corner-tr ui-helper-clearfix"lfr>t<"fg-toolbar ui-widget-header ui-corner-bl ui-corner-br ui-helper-clearfix"ip>' }); }); </script> </head> TOP piece of HTML <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>Home</title> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <link rel="stylesheet" type="text/css" href="style.css" /> <link rel="stylesheet" type="text/css" href="default.css" /> <script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/1.4.3/jquery.min.js"></script> <style type="text/css" title="currentStyle"> @import "TableTools.css"; @import "demo_table_jui.css"; @import "jquery-ui-1.8.4.custom.css"; </style> <script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jqueryui/1.8.6/jquery-ui.min.js"></script> <script type="text/javascript" src="js/jquery.dataTables.min.js"></script> <script type="text/javascript" src="js/TableTools/TableTools.js"></script> <script type="text/javascript" src="ZeroClipboard/ZeroClipboard.js"></script> <script type="text/javascript"> $(document).ready(function() { TableToolsInit.sSwfPath = "ZeroClipboard.swf"; oTable = $('#sortable').dataTable({ "bRetrieve": true, "bProcessing": true, "sScrollX": "100%", "sScrollXInner": "110%", "bScrollCollapse": true, "bJQueryUI": true, "sPaginationType": "full_numbers", "sDom": 'T<"clear"><"fg-toolbar ui-widget-header ui-corner-tl ui-corner-tr ui-helper-clearfix"lfr>t<"fg-toolbar ui-widget-header ui-corner-bl ui-corner-br ui-helper-clearfix"ip>' }); }); </script> </head> <body bgcolor="#e0e0e0"> <div class="main"> <div class="body"> <div class="body_resize"> <div class="liquid-round"> <div class="top"><span><h2>Details</h2></span></div> <div class="center-content"> <div style="overflow-x:hidden; min-height:400px; max-height:600px; overflow-y:auto;"> <div class="demo_jui"><br /> <table cellpadding="0" cellspacing="0" border="0" class="display" width="100%" id="sortable"> <thead> <tr> <th>First Name</th> <th>MI</th> <th>Last Name</th> <th>Street Address</th> <th>City</th> <th>State</th> <th>Zip</th> <th>DOB</th> <th>Gender</th> <th>Spouse Name</th> <th>Spouse Date of Birth</th> <!-- this part is generated with the php, when removed, datatables works just fine with the rest of the page --> <th>Dependent Child Name 1</th> <th>Dependent Date of Birth 1</th> <th>Dependent Child Name 2</th> <th>Dependent Date of Birth 2</th> <th>Dependent Child Name 3</th> <th>Dependent Date of Birth 3</th> <th>Dependent Child Name 4</th> <th>Dependent Date of Birth 4</th> <th>Dependent Child Name 5</th> <th>Dependent Date of Birth 5</th> <th>Dependent Child Name 6</th> <th>Dependent Date of Birth 6</th> <th>Dependent Child Name 7</th> <th>Dependent Date of Birth 7</th> </tr> </thead> <tbody> <tr> ... UPDATE REGARDING COMMENTS/ANSWERS I have received a number of responses indicating the number of headers may not match the field count in the body. As I mention below, eliminating the php script below altogether would eliminate 5+ fields in the header and without question throw the count match off balance. This DOES NOT however cause an error and in fact "resolves" the issue in that datatables functions properly (even though there is NO header record for 5+ fields in the body.

    Read the article

  • Jqgrid search option hides the grid table

    - by Felix Guerrero
    The issue is when I click on search option (on pager) it shows the search window but the grid gets hide. I'm including the jqmodal.js file. But what I'm ignoring on the code below? css files: jqModal.css jquery-ui-1.8.custom.css ui.jqgrid.css ui.multiselect.css jquery.searchFilter.css js files: jquery.min.js grid.base.js grid.common.js grid.formedit.js grid.setcolumns.js ui.multiselect.js jquery.searchFilter.js jqModal.js The Javascript: $("#list").jqGrid({ url: 'foo_report.php?g=' + $('#fooselect').val() + '&report=1&searchString=null&searchField=null&searchOper=null', datatype: 'json', mtype: 'GET', colNames: ['foo1','foo2', 'foo3'], colModel: [ { name:'rows.foobar1', index: 'foobar1', search:true, jsonmap: 'foobar1', width: 150, align: 'left', sortable:true}, { name:'rows.foobar2', index: 'foobar2', jsonmap: 'foobar2', width: 150, align: 'left'}, { name:'rows.foobar3', index: 'foobar3', jsonmap: 'foobar3', width: 240, align: 'left', sortable: true}], pager: '#pager', rowNum: 8, autowidth: true, rowList: [8, 16], sortname: 'foobar1', sortorder: 'asc', viewrecords: true, search : { caption: "Search...", Find: "Find", Reset: "Reset", odata : ['equal', 'not equal', 'less'], groupOps: [ { op: "AND", text: "all" }, { op: "OR", text: "any" }], matchText: " match", rulesText: " rules" }, caption: 'Foobar Data', jsonReader : { root: "rows", repeatitems: false }, height: 350, width: 800 }); html: <table id="list"></table> <div id="pager"></div>

    Read the article

  • display tag query

    - by sarah
    I have code: <display:table name="sessionScope.allUserslist" id="userList" export="false" pagesize="1"> <display:column title="Select" style="width: 90px;"> <input type="checkbox" name="optionSelected" value="<c:out value='${userList.loginName}'/>"/> </display:column> <display:column property="loginName" sortable="false" title="UserName" paramId="loginName" style="width: 150px; text-align:center" href="./editUser.do?method=editUser"/> <display:column property="role" sortable="false" title="UserRole" paramId="role" style="width: 150px; text-align:center"/> </display:table> On click of login name, I am moving to a new page where I need to get all the of user, I am just getting the name not the role, on click of link I am calling an action where in the method I am trying to read the data from the form using User u=(User)form; u.getRole(); but it's null. Where am I going wrong ?

    Read the article

  • After rich:extendedDataTable sortby,otheractions are not getting executed

    - by user118802
    I have a RichFaces UI which are having sidebar menu and sidebar had 8 links. I am using Seam @DataModel and @Factory and hibernate criteria to populate all the 8 pages. In all the pages i have sortby functionality which is working fine. I am able to get all data in all the 8 pages and I can freely navigate around all the links/xhtmls. But if in one of the xhtmlpages if I do sorting or groupby after that I am unable to navigate to other pages.If I select any other link the same last query which is executed for sorting is getting executed. Is this an issue? or do I need add any configuration. Please help me in solving this issue. Below is the codesnippet one of the 8 xhtml <rich:column sortable="true" sortBy="#{p.regionid}" width="100px" label="Region Id"> <f:facet name="header"> <h:outputText value="Region Id" /> </f:facet> <h:outputText value="#{p.regionid}" /> </rich:column> <rich:column sortable="true" sortBy="#{p.region}" width="100px" label="Region Name"> <f:facet name="header"> <h:outputText value="Region Name" /> </f:facet> <h:outputText value="#{p.region}" /> </rich:column> Sidebar Action @DataModel("regions") private List<CoreRegion> listRegions; @Factory("regions") public void getRegions() { System.out.println("Inside get Regions"); Session userDatabase = HibernateUtil.getSession(); Criteria crit = userDatabase.createCriteria(CoreRegion.class); listRegions = crit.list();

    Read the article

  • ExtJs Grid in TabPanel auto Fit issue.

    - by Jinah Adam
    Hi, I am having problems redering an grid in a a tab panel (Its made with Ext Designer.). the hierarchy is as follows , Viewport. - tabPanel - Panel - Container - Grid. This is how its displayed now Here is the code for viewport mainWindowUi = Ext.extend(Ext.Viewport, { layout: 'border', id: 'mainWindow', initComponent: function() { this.items = [ { xtype: 'panel', title: 'Navigation', region: 'west', width: 200, frame: true, split: true, titleCollapse: true, collapsible: true, id: 'navigation', items: [ { flex: 1, xtype: 'mytreepanel' } ] }, { xtype: 'tabpanel', layoutOnTabChange: true, resizeTabs: true, defaults: { layout: 'fit', autoScroll: true }, region: 'center', tpl: '', id: 'mainTabPanel', layoutConfig: { deferredRender: true } } ]; mainWindowUi.superclass.initComponent.call(this); } }); here is the code to create the tab.. (created from a nav panel programmatically) var currentTab = tabPanel.findById(node.id); // If not yet created, create the tab if (!currentTab){ currentTab = tabPanel.add({ title:node.id, id:node.id, closable:true, items:[{ xtype: 'phasePanel', layout: 'fit', autoscroll: true, }], autoScroll:true, }); } // Activate tab tabPanel.setActiveTab(currentTab); here is the code for the panel/container/grid PhasePanelUi = Ext.extend(Ext.Panel, { frame: true, layout: 'anchor', autoScroll: true, autoWidth: true, defaults: '', initComponent: function() { this.items = [ { xtype: 'container', autoScroll: true, layout: 'fit', defaults: { layout: 'fit', autoScroll: true }, id: 'gridHolder', items: [ { xtype: 'grid', title: 'Current Phases', store: 'PhaseStore', autoDestroy: false, viewConfig: '', deferRowRender: false, autoLoad: '', ref: '../phaseGrid', id: 'phaseGrid', columns: [ { xtype: 'gridcolumn', header: 'Name', dataIndex: 'name', sortable: true, width: 200 }, { xtype: 'gridcolumn', header: 'Estate', dataIndex: 'estate_name', sortable: true, width: 500 } ] } ] } ]; PhasePanelUi.superclass.initComponent.call(this); } }); i have tried all sorts of combinations. but just cant get the grid to render correctly any sort of assistance will be appreciated.

    Read the article

  • How to bind an ADF Table on button click

    - by Juan Manuel Formoso
    Coming from ASP.NET I'm having a hard time with basic ADF concepts. I need to bind a table on a button click, and for some reason I don't understand (I'm leaning towards page life cycle, which I guess is different from ASP.NET) it's not working. This is my ADF code: <af:commandButton text="#{viewcontrollerBundle.CMD_SEARCH}" id="cmdSearch" action="#{backingBeanScope.indexBean.cmdSearch_click}" partialSubmit="true"/> <af:table var="row" rowBandingInterval="0" id="t1" value="#{backingBeanScope.indexBean.transactionList}" partialTriggers="::cmdSearch" binding="#{backingBeanScope.indexBean.table}"> <af:column sortable="false" headerText="idTransaction" id="c2"> <af:outputText value="#{row.idTransaction}" id="ot4"/> </af:column> <af:column sortable="false" headerText="referenceCode" id="c5"> <af:outputText value="#{row.referenceCode}" id="ot7"/> </af:column> </af:table> This is cmdSearch_click: public String cmdSearch_click() { List l = new ArrayList(); Transaction t = new Transaction(); t.setIdTransaction(BigDecimal.valueOf(1)); t.setReferenceCode("AAA"); l.add(t); t = new Transaction(); t.setIdTransaction(BigDecimal.valueOf(2)); t.setReferenceCode("BBB"); l.add(t); setTransactionList(l); // AdfFacesContext.getCurrentInstance().addPartialTarget(table); return null; } The commented line also doesn't work. If I populate the list on my Bean's constructor, the table renders ok. Any ideas?

    Read the article

< Previous Page | 4 5 6 7 8 9 10 11 12 13 14  | Next Page >