Search Results

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

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

  • jqGrid formatter and sortable column - doesn't sort

    - by HeavyWave
    I am using a custom formatter for my jqGrid columnModel and I can't get sorting to work with formatter functions. If I remove formatter column sorts normally. colModel: [ { name: 'status', index: 'status', width: 18, sorttype: 'int', align: 'center', formatter: function(cellvalue, options, rowObject) { return cellvalue == 1 ? "<img src='images/agent_green_s.png' alt='Ready' title='Ready' />" : cellvalue == 3 ? "<img src='images/agent_red_s.png' alt='Busy' title='Busy' />" : "<img src='images/agent_orange_s.png' alt='Pending Ready' title='Pending Ready' />"; } How do I get sorting to work properly?

    Read the article

  • making html table columns optionally sortable

    - by jdamae
    I have an html table that is populated from a text file, formatted and semi colon separated. I would like the user to have the option of sorting alphabetically with either of the columns when clicking on the column name (header). How do I do this in php?? Or is there another way of doing this? Thanks for your help. Sample raw data/input looks like this: TYPE=abc;PART=georgetown;FILE=goog_abc.dat.2010122211.gz TYPE=xyz;PART=ucny;FILE=aol_xyz.dat.2010122209.gz Php code for table: $lines = preg_split('~\s*[\r\n]+\s*~', file_get_contents('/temp/tab.txt')); foreach($lines as $i => $line) { $pairs = explode(';', $line); foreach($pairs as $pair) { list($column, $value) = explode('=', $pair, 2); $columns[$column] = true; $rows[$i][$column] = $value; } } $columns = array_keys($columns); echo '<table><thead><tr>'; foreach($columns as $column) { echo '<th>'.$column.'</th>'; } echo '</tr></thead><tbody>'; foreach ($rows as $row) { echo '<tr>'; foreach($columns as $column){ echo '<td>'.$row[$column].'</td>'; } echo '</tr>'; } echo '</tbody></table>';

    Read the article

  • Javascript get li values and encode them

    - by bluedaniel
    At the moment I have two (maybe more) unordered lists which are sortable with jquery and ui. The things that work are that the lists are connected, items are draggable, items can be removed and a form that adds to the list. What I need however is a function that gets all the content for li items and json encode them ready to be sent off to some db function, or something. Im new to jquery however and cant find documentation for li items. Hope Ive explained this well. Daniel

    Read the article

  • Preventing click event with jQuery drag and drop

    - by Sasha Yanovets
    I have an elements on page that are draggabe with jQuery. These elements have click event wich navigates to another page (ordinary links for example). What is the best way to prevent click from firing on dropping such element, while allowing clicking it in not drag and drop state? I have this problem with sortable elements, but think it is good to have solution for general drag and drop. I've solved the problem for myself. After that found that same solution exists for Scriptaculous, but maybe someone have a better way to achieve that.

    Read the article

  • Given the Following List (UL), how can it be serialized and sent to the Database

    - by nobosh
    I have the follow structure which is created with a nested sortable: <UL id="container"> <LI id="main1"> <input type="checkbox" /> Lorem ipsum dolor sit amet, consectetur <UL> <LI id="child2"> <input type="checkbox" /> In hac habitasse platea dictumst. <UL></UL> </LI> </UL> </LI> <LI id="main3"> <input type="checkbox" /> In hac habitasse platea dictumst. <UL></UL> </LI> <LI id="main4"> <input type="checkbox" /> In hac habitasse platea dictumst. <UL></UL> </LI> <LI id="main5"> <input type="checkbox" /> In hac habitasse platea dictumst. <UL></UL> </LI> </UL> Where I'm stuck is how to send this back to the database. I"m guessing that it needs to be serialized, does that sound right to? so that is looks something like: item[]=main1&item[]=221&item_221[]=21&item_221[]=2&item_221[]=211&item[]=22 I'm a little lost at this point and appreciate any tips to move me in the right direction. Thanks, B

    Read the article

  • Using sortable_element in Rails on a list generated by a find()

    - by Eli B.
    Hey all, I'm trying to use the scriptaculous helper method sortable_element to implement a drag-and-drop sortable list in my Rails application. While the code for the view looks pretty simple, I'm really not quite sure what to write in the controller to update the "position" column. Here's what I've got in my view, "_show_related_pgs.erb": <ul id = "interest_<%=@related_interest.id.to_s%>_siblings_list"> <%= render :partial => "/interests/peer_group_map", :collection => @maps, :as => :related_pg %> </ul> <%= sortable_element("interest_"+@related_interest.id.to_s+"_siblings_list", :url => {:action => :resort_related_pgs}, :handle => "drag" ) %> <br/> And here's the relevant line from the partial, "interests/peer_group_map.erb" <li class = "interest_<%=@related_interest.id.to_s%>_siblings_list" id = "interest_<%=related_pg.interest_id.to_s%>_siblings_list_<%=related_pg.id.to_s%>"> The Scriptaculous UI magic works fine with these, but I am unsure as to how to change the "position" column in the db to reflect this. Should I be passing the collection @maps back to the controller and tell it to iterate through that and increment/decrement the attribute "position" in each? If so, how can I tell which item was moved up, and which down? I couldn't find anything specific using Chrome dev-tools in the generated html. After each reordering, I also need to re-render the collection @maps since the position is being printed out next to the name of each interest (I'm using it as the "handle" specified in my call to sortable_element() above) - though this should be trivial. Any thoughts? Thanks, -e

    Read the article

  • Getting JQuery UI Sortable to work on asp.net ListView items?

    - by Xaisoft
    I have the following ListView in which I am using the JQuery UI sortable function to be able to sort the items in the ListView. The problem is that I can't put a sortable class on the table in the ItemTemplate because it does not work, if I put a class="sortable" on the outer div, it works, but it allows me to sort everything within the ListView, I just want to be able to move sort the tables. Here is the markup <div> //Works here, but hr's become sortable too. <asp:ListView ID="lvwDocuments" runat="server"> <LayoutTemplate> <h3> Documents</h3> <asp:PlaceHolder ID="itemPlaceHolder" runat="server"> </asp:PlaceHolder> </LayoutTemplate> <ItemTemplate> <table class="sortable"> //Does not work Here <tr> <td> <p class="title"> <a runat="server" href='<%#Eval("url") %>'> <%#Eval("title") %></a></p> <br /> <p> <%#Eval("description") %></p> </td> </tr> </table> </ItemTemplate> <ItemSeparatorTemplate> <hr /> </ItemSeparatorTemplate> </div> Also, How can I preserve the sort order even after the page is refreshed.

    Read the article

  • jQuery nested sortables jumpy behaviour

    - by sebbie
    I want to allow user to drag and drop UI elements. I've 'container' and 'control', control may be in container, containers may include other containers (this is important requirement). I created simple prototype using jQuery. HTML: <div class="one"> <div class="control">Control 1</div> <div class="control">Control 2</div> <div class="control container"> Container drag area <div class="control">Subcontrol 1</div> <div class="control">Subcontrol 2</div> <div class="control">Subcontrol 3</div> <div class="control">Subcontrol 4</div> <div class="control">Subcontrol 5</div> <div class="control">Subcontrol 6</div> <div class="control">Subcontrol 7</div> <div class="control">Subcontrol 8</div> <div class="control">Subcontrol 9</div> </div> <div class="control">Control 3</div> Then I created sortables using jQueryUI: $('.one').sortable({ items: 'div.control', placeholder: 'placeholder', forcePlaceholderSize: true }); Now when I'm trying to drag "Subcontrol 8" and place it between "Subcontrol 2" and "Subcontrol 3" for example I'm getting jumpy effect, you can observe it here: http://jsbin.com/egipu4/2 Interesting thing is - when I remove ability to drag "container" then it becomes smooth and perfect (you can see this on jsbin example below "jumpy" example, you can't drag using "Container drag area" span). I tried different "nested" plugins and techniques, google'd for a long time and the only one that worked was on this page: (StackOverflow doesn't allow me to post more than one like, google for "Brian Swartzfager's Blog: Nested List Sort Demo" should be first, sorry!) But it does work great only in jQuery1.2 and very old jQueryUI. If I include latest jQuery (1.3/1.4) and UI (1.7/1.8) it gets jumpy as well. What am I doing wrong?

    Read the article

  • JQUERY-UI Draggables - Seralize is running before the Draggable is complete

    - by nobosh
    Hello, I'm using the JQUERY-UI draggable plugin. As a setting, when the Draggable is done, using the STOP setting I run a function to seralize a list of LIs to get their order in terms of their IDs. For example, if I have an UL, with a list of LIs with the following IDs: 1,2,3,4,5 If I then move 5, between 2&3, the seralize is returning: 1,2,5,3,4,5 Which makes me think that the JQUERY UI-Draggable STOP is running before the page is finished rendering, or the DOM isn't update? Any ideas on how I can fix this from happening. Is there something I can do in my Seralize funtion to say, wait till JQUERY animations are all done, or stop all that are going on to ensure the DOM is accurate? Thanks

    Read the article

  • Using SortableRows and know when rows have been moved

    - by DW
    I want to take advantage of the sortableRows property of the jqGrid. How do I detect when a row has been moved. I have studied the documentation and looked for examples but haven't found much. I do believe it is something like jQuery("#grid").sortableRows({connectWith:'#gird', ondrop: function(){ alert("row moved") }}); but that does not work. I can move the rows, but don't seemed to have trapped the event. Is there something wrong with my syntax or my approach in general. Basically, I need to know that the rows have been rearranged so I can be sure they get saved with their new order. Thanks

    Read the article

  • How to reorder table rows (drag-and-drop) along with their sub rows

    - by Eirik Johansen
    I have a table which looks like this (simplified for the example): <table> <tr class="lvl_1"> <td> Level 1 </td> </tr> <tr class="lvl_2"> <td> Level 2 </td> </tr> <tr class="lvl_3"> <td> Level 3 </td> </tr> <tr class="lvl_1"> <td> Level 1 </td> </tr> <tr class="lvl_2"> <td> Level 2 </td> </tr> <tr class="lvl_3"> <td> Level 3 </td> </tr> The content in the rows with the lvl_3 class are children of the previous lvl_2 row, and the lvl_2 rows are children of the previous lvl_1. Had the data been a list, it would have looked something like this: Level 1 -- Level 2 ---- Level 3 Level 1 -- Level 2 ---- Level 3 I'm not looking to implement drag-and-drop sorting functionality, make it possible to rearrange the level 1 and two rows. The tricky part is that once I start moving a row, the corresponding children (and grand-children, if any) should move along with it. Is this even possible with the current markup, or do I have to rearrange the code? Thanks in advance !

    Read the article

  • jquery - setting a limit of items, that can be dragged into a list

    - by maschek
    Hi, i have this two lists, from which i can move items from one to another with jquery ui and connect lists, with ajax. If an item is pulled over, a message is generated in a php file and then it appears on screen. Now i want that for example the right list should be allowed to contain ten items at max. It would be great if it would be possible with jquery, that if there is already ten items in the list and you go and drag the eleventh, if then the item would somehow vanish, maybe with a little effekt. I think maybe reading out db in the php-file if theres already ten items, and so on. But i have currently no idea, if and in case if in which way, jquery would support this kind of behaviour. Can you give me some advise? Greetings, maschek

    Read the article

  • Gridview SortExpression with 2 fields

    - by aron
    Hello, I have a GridView that get's its datasource from a complex object. So I'm doing the Sorting & Paging in the code behind. <asp:GridView ID="SystemsDetailList" runat="server" AllowSorting="true" AllowPaging="true" AutoGenerateColumns="False" ShowFooter="True" OnPageIndexChanging="gridView_PageIndexChanging" OnSorting="gridView_Sorting"> For an important title column I have a SortExpression with 2 fields: SortExpression="FunctionalAreaDisplayCode, EswbsDisplayCode" This in the code behind: protected void gridView_Sorting(object sender, GridViewSortEventArgs e) { BindSystemList(e.SortExpression, sortOrder); } public string sortOrder { get { if (ViewState["sortOrder"].ToString() == "desc") { ViewState["sortOrder"] = "asc"; } else { ViewState["sortOrder"] = "desc"; } return ViewState["sortOrder"].ToString(); } set { ViewState["sortOrder"] = value; } } For some reason it will keep "FunctionalAreaDisplayCode" always sorted ASC but the EswbsDisplayCode works fine as it flips between ASC and DESC correctly. and tips here? thanks!

    Read the article

  • sortable + draggable demo - how to get access to dropped item?

    - by user246114
    Hi, I have a sortable list. When a new item is dropped into the list (from a draggable), I'd like to get access to it to perform some operations on it. This is what I have: $("#mySortableList").sortable({ receive: function(event, ui) { alert("this is the dropped item: " + ui.item.toString()); } }).disableSelection(); so "ui.item" is the element that was dropped, but it's not the duplicated item that will now be part of my list. How do I get access to the new item that was dropped? I am using the exact demo from the jquery-ui site here: http://jqueryui.com/demos/draggable/#sortable Thanks

    Read the article

  • display image in a grid using extjs

    - by Abisha
    I am new to extjs. I want to display icon images for each grid elements. can you please healp me anybody? i am getting the image path from an xml file. my code is below. here i am displaying image path. i have to replace it by displaying image. Ext.onReady(function(){ var store = new Ext.data.Store({ url: 'new_frm.xml', reader: new Ext.data.XmlReader({ record: 'message', fields: [{name: 'first'},{name: 'last'},{name: 'company'},{name: 'email'},{name: 'gender'},{name: 'form-file'},{name: 'state'},{name: 'Live'},{name: 'content'}] }) }); var grid = new Ext.grid.GridPanel({ store: store, columns: [ {header: "First Name", width: 120, dataIndex: 'first', sortable: true}, {header: "Last Name", width: 180, dataIndex: 'last', sortable: true}, {header: "Company", width: 115, dataIndex: 'company', sortable: true}, {header: "Email", width: 100, dataIndex: 'email', sortable: true}, {header: "Gender", width: 100, dataIndex: 'gender', sortable: true}, {header: "Photo", width: 100, dataIndex: 'form-file', sortable: true}, {header: "State", width: 100, dataIndex: 'state', sortable: true}, {header: "Living with", width: 100, dataIndex: 'Live', sortable: true}, {header: "Commands", width: 100, dataIndex: 'content', sortable: true} ], renderTo:'example-grid', height:200 }); store.load(); });

    Read the article

  • Is there a way to create a python object that will be not sortable?

    - by Graf
    Is there a possibility to create any python object that will be not sortable? So that will be an exception when trying to sort a list of that objects? I created a very simple class, didn't define any comparison methods, but still instances of this class are comparable and thus sortable. Maybe, my class inherits comparison methods from somewhere. But I don't want this behaviour.

    Read the article

  • How do I connect multiple sortable lists to each other in jQuery UI?

    - by Abs
    I'm new to jQuery, and I'm totally struggling with using jQuery UI's sortable. I'm trying to put together a page to facilitate grouping and ordering of items. My page has a list of groups, and each group contains a list of items. I want to allow users to be able to do the following: 1. Reorder the groups 2. Reorder the items within the groups 3. Move the items between the groups The first two requirements are no problem. I'm able to sort them just fine. The problem comes in with the third requirement. I just can't connect those lists to each other. Some code might help. Here's the markup. <ul id="groupsList" class="groupsList"> <li id="group1" class="group">Group 1 <ul id="groupItems1" class="itemsList"> <li id="item1-1" class="item">Item 1.1</li> <li id="item1-2" class="item">Item 1.2</li> </ul> </li> <li id="group2" class="group">Group 2 <ul id="groupItems2" class="itemsList"> <li id="item2-1" class="item">Item 2.1</li> <li id="item2-2" class="item">Item 2.2</li> </ul> </li> <li id="group3" class="group">Group 3 <ul id="groupItems3" class="itemsList"> <li id="item3-1" class="item">Item 3.1</li> <li id="item3-2" class="item">Item 3.2</li> </ul> </li> </ul> I was able to sort the lists by putting $('#groupsList').sortable({}); and $('.itemsList').sortable({}); in the document ready function. I tried using the connectWith option for sortable to make it work, but I failed spectacularly. What I'd like to do is have the every groupItemsX list connected to every groupItemsX list but itself. How should I do that?

    Read the article

  • Displaytag export option is not working

    - by Nirmal
    Hello All, I am using Displaytag framework for pagination & exporting purpose. In that i am also using Strut2Tiles Integration. Whenever i am calling any action class it will returning me a list & through Displaytag i am successfully displaying record on my page. For that my jsp page's code looks like : <s:set name="selectedPageSize" value="selectedPageSize" scope="request"/> <s:set value="accountList" scope="request" name="accountList"/> <display:table name="accountList" export="true" class="table" requestURI="" id="accountList" pagesize="${selectedPageSize}" > <display:setProperty name="export.pdf" value="true" /> <display:column property="id" sortable="true" class="sort-title"/> <display:column property="name" sortable="true"/> <display:column property="contactPerson" sortable="true"/> <display:column property="phone1" sortable="true"/> <display:column property="phone2" sortable="true"/> <display:column property="fax" sortable="true"/> <display:column property="email" sortable="true"/> <display:column property="webSite" sortable="true"/> <display:column property="address1" sortable="true"/> <display:column property="address2" sortable="true"/> <display:column property="countryId.name" title="Country" sortable="true"/> <display:column property="stateId.name" title="State" sortable="true"/> <display:column property="countryId.name" title="City" sortable="true"/> <display:column property="isDeleted" sortable="true"/> <display:column title="Delete"> <s:url id="removeUrl" action="finance/deleteAccount.action"> <s:param name="id" value="#attr.accountList.id" /> </s:url> <s:a href="%{removeUrl}" theme="ajax" targets="accountList">Remove</s:a> </display:column> <display:column title="Update"> <s:url id="updateUrl" action="finance/updateAccount.action"> <s:param value="#attr.accountList.id" name="id"/> </s:url> <s:a href="%{updateUrl}&action=update" targets="accountlist">Update</s:a> </display:column> Actually this page is displaying through tiles configuration. Here i have enabled the export option, so it is showing me the exporting options like CSV, EXCEL, XML. But whenver i am clicking on that CSV link, my web browser hanged, means nothing is displayed on it For that exporting solution i have also added filter in my web.xml. My web.xml looks like: <filter> <filter-name>struts2</filter-name> <filter-class>org.apache.struts2.dispatcher.FilterDispatcher</filter-class> </filter> <filter-mapping> <filter-name>struts2</filter-name> <url-pattern>/*</url-pattern> </filter-mapping> <filter> <filter-name>ResponseOverrideFilter</filter-name> <filter-class>org.displaytag.filter.ResponseOverrideFilter</filter-class> </filter> <filter-mapping> <filter-name>ResponseOverrideFilter</filter-name> <url-pattern>*.action</url-pattern> </filter-mapping> <filter-mapping> <filter-name>ResponseOverrideFilter</filter-name> <url-pattern>*.jsp</url-pattern> </filter-mapping> <listener> <listener-class>org.apache.struts2.tiles.StrutsTilesListener</listener-class> </listener> <listener> <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class> </listener> <context-param> <param-name>contextConfigLocation</param-name> <param-value>/WEB-INF/classes/webApplicationContext.xml</param-value> </context-param> <welcome-file-list> <welcome-file>jsp/welcome.jsp</welcome-file> </welcome-file-list> I have also included following list of libraries of displaytag : 1) displaytag-1.2.jar 2) displaytag-export-poi-1.2.jar 3) displaytag-portlet-1.2.jar The exception that i am getting is : 2009-05-09 12:02:38,234 DEBUG (org.displaytag.tags.TableTag:1524) - Exportfilter NOT enabled 2009-05-09 12:02:38,312 WARN (org.displaytag.tags.TableTag:63) - Exception: [.TableTag] Unable to reset response before returning exported data. You are not using an export filter. Be sure that no other jsp tags are used before display:table or refer to the displaytag documentation on how to configure the export filter (requires j2ee 1.3). ApplicationDispatcher[/PaginationTry2] PWC1231: Servlet.service() for servlet jsp threw exception Exception: [.TableTag] Unable to reset response before returning exported data. You are not using an export filter. Be sure that no other jsp tags are used before display:table or refer to the displaytag documentation on how to configure the export filter (requires j2ee 1.3). Plz reply, i am stuck with this problem.

    Read the article

  • GridPanel in Extjs is not loaded

    - by pho3nix
    I have this code in my application, but this not load any data. Data is accessible but wont display in my gridpanel, anyone have idea, why? Ext.onReady(function () { Ext.QuickTips.init(); Ext.form.Field.prototype.msgTarget = 'side'; var btnAdd = new Ext.Button({ id: 'btnAdd', text: 'Adicionar', iconCls: 'application_add', handler: function (s) { } }); var btnEdit = new Ext.Button({ id: 'btnEdit', text: 'Editar', iconCls: 'application_edit', handler: function (s) { } }); var btnRemove = new Ext.Button({ id: 'btnRemove', text: 'Apagar', iconCls: 'application_delete', handler: function (s) { } }); var tbar = new Ext.Toolbar({ items: [btnAdd, btnEdit, btnRemove] }); var formFind = new Ext.FormPanel({ height: 100 }); var store = new Ext.data.JsonStore({ remoteSort: true, idProperty: 'ContentId', root: 'rows', totalProperty: 'results', fields: [ { name: 'ContentId', type: 'int' }, { name: 'Name' }, { name: 'Version' }, { name: 'State' }, { name: 'CreatedDateTime' }, { name: 'PublishedDateTime'}, { name: 'CreatedByUser' }, { name: 'PublishedByUser' } ], proxy: new Ext.data.ScriptTagProxy({ url: '/Admin/ArticleList' }) }); store.setDefaultSort('ContentId', 'desc'); var paging = new Ext.PagingToolbar({ store: store, pageSize: 25, displayInfo: true, displayMsg: 'Foram encontrados {2} registos. Mostrando {0} de {1}', emptyMsg: "Nenhum registo encontrado." }); var grid = new Ext.grid.GridPanel({ id: 'grid', height: 700, store: store, loadMask: true, loadingText: 'Carregando...', autoHeight: true, cm: new Ext.grid.ColumnModel ([ { id: 'ContentId', dataIndex: 'ContentId', header: 'Identif.', width: 60, sortable: true }, { id: 'Name', dataIndex: 'Name', header: 'Titulo', width: 75, sortable: true }, { id: 'Version', dataIndex: 'Version', header: 'Versão', width: 75, sortable: true }, { id: 'State', dataIndex: 'State', header: 'Estado', width: 75, sortable: true }, { id: 'CreatedDateTime', dataIndex: 'CreatedDateTime', header: 'Data de Criação', width: 85, sortable: true }, { id: 'PublishedDateTime', dataIndex: 'PublishedDateTime', header: 'Data de Publicação', width: 75, sortable: true }, { id: 'CreatedByUser', dataIndex: 'CreatedByUser', header: 'Criado por', width: 75, sortable: true }, { id: 'PublishedByUser', dataIndex: 'PublishedByUser', header: 'Publicado por', width: 85, sortable: true } ]), stripeRows: true, viewConfig: { forceFit: true }, bbar: paging }); var panel = new Ext.Panel({ id: 'panel', renderTo: Ext.getBody(), layout: 'fit', tbar: tbar, items: [grid] }); store.load(); // trigger the data store load });

    Read the article

  • How can I get jQuery UI's Draggable and Sortable functions to work on the iPhone?

    - by Damovisa
    I have a page that uses JQuery UI; in particular the Sortable interaction. The page works fine for desktop web browsers with mice, however I can't get the drag-drop functionality to work on Mobile Safari on the iPhone. Any dragging action simply scrolls the page. The functionality on my page is extremely similar to the Sortable Empty-Lists demo on the JQuery UI site. This page also doesn't work on the iPhone. Is there any way to get the drag-drop functions working on the iPhone?

    Read the article

  • How can I display a list of three different Models sortable by the same :attribute in rails?

    - by Angela
    I have a Campaign model which has_many Calls, Emails, and Letters. For now, these are each a separate Model with different controllers and actions (although I would like to start to think of ways to collapse them once the models and actions stabilize). They do share two attributes at least: :days and :title I would like a way to represent all the Calls, Emails, and Letters that belong_to a specific Campaign as a sortable collection (sortable by :days), in a way that outputs the model name and the path_to() for each. For example (I know the below is not correct, but it represents the kind of output/format I've been trying to do: @campaign_events.each do |campaign_event| <%= campaign_event.model_name %> <%= link_to campaign_event.title, #{model_name}_path(campaign_event) %> end Thanks so much. BTW, if this matters, I would then want to make the :days attribute editable_in_place.

    Read the article

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