Search Results

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

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

  • jqGrid dynamic select option - beforeEditCell not firing

    - by mango
    I'm creating a jqgrid with one drop down column. I need the options of the drop down columns to change dynamically so I thought I can catch the beforeCellEdit event. however it does not seem to be firing. any idea on what i am doing wrong? there is no error, and i did check that i have included the jqgrid edit js files. var lastsel2; jQuery(document).ready(function(){ jQuery("#projectList").jqGrid({ datatype: 'json', url:'projectDrv.jsp', mtype: 'GET', height: 250, colNames:['Node','Proposal #', 'Status', 'Vendor', 'Actions'], colModel :[ {name:'node', index:'node', width:100, editable:false, sortable:false}, {name:'proposal', index:'proposal', width:100, editable:false, resizable:true }, {name:'status', index:'status', width:100, resizable:true, sortable:false, editable:false }, {name:'vendor', index:'vendor', width:100, resizable:true, editable:false, sortable: false }, {name:'actions', index:'actions', width:100, resizable:true, sortable:false, editable: true, edittype:"select" } ], pager: '#pager', rowNum: 10, sortname: 'proposal', sortorder: 'desc', viewrecords: true, onSelectRow: function(id){ if (id && id!==lastsel2){ jQuery('#projectList').jqGrid('restoreRow',lastsel2); jQuery('#projectList').jqGrid('editRow',id,true); lastsel2 = id; } }, beforeEditCell: function(rowid, cellname, value, irow, icol) { alert("before edit here " + rowid); // set editoptions here } });

    Read the article

  • Using Flexigrid with an xml formatted source how do you specify how the xml is formatted?

    - by stormist
    I have my columns set as follows: colModel : [ {display: 'column1', name : 'column1', width : 200, sortable : true, align: 'center'}, {display: 'column2', name : 'column2', width : 100, sortable : true, align: 'left'}, {display: 'column3', name : 'column3', width : 100, sortable : true, align: 'left'}, {display: 'column4', name : 'column4', width : 300, sortable : true, align: 'left'}, ], I set my data source to a url that returns xml. The xml is like this: <?xml version="1.0"?> <items_list> <item> <column1>BlahBlah</column1> <column2>BlahBlah</column2> <column3>BlahBlah</column3> <column4>BlahBlah</column4> </item> <item> <column1>BlahBlah</column1> <column2>BlahBlah</column2> <column3>BlahBlah</column3> <column4>BlahBlah</column4> </item> </items_list> How can I bind the grid to the xml datasource, it doesn't appear to recognize it as it is?

    Read the article

  • GRID is not properly rendered in ExtJS 4 by using Store

    - by user548543
    Here is the Src code for HTML file <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4 /strict.dtd"> <html> <head> <title>MVC Architecture</title> <link rel="stylesheet" type="text/css" href="/bh/extjs/resources/css/ext-all.css" /> <script type="text/javascript" src="extjs/ext-debug.js"></script> <script type="text/javascript" src="Main.js"></script> </head> <body> </body> </html> File path: /bh/Main.js [Main File] Ext.require('Ext.container.Viewport'); Ext.application({ name: 'App', appFolder: 'app', controllers: ['UserController'], launch: function() { Ext.create('Ext.container.Viewport', { layout: 'border', items: [ { xtype: 'userList' } ] }); } }); File path: /app/controller/UserController.js [Controller] Ext.define('App.controller.UserController',{ extend: 'Ext.app.Controller', stores: ['UserStore'], models:['UserModel'], views:['user.UserList'], init: function() { this.getUserStoreStore().load(); } }); File path: /app/store/UserStore.js Ext.define('App.store.UserStore', { extend: 'Ext.data.Store', model: 'App.model.UserModel', proxy: { type: 'ajax', url: 'app/data/contact.json' } }); File path: /app/model/UserModel.js [Model] Ext.define('App.model.UserModel',{ extends:'Ext.data.Model', fields:[ {name: 'name', type: 'string'}, {name: 'age', type: 'string'}, {name: 'phone', type: 'string'}, {name: 'email', type: 'string'} ] }); File path: /app/view/UserList.js [View] Ext.define('App.view.user.UserList' ,{ extend: 'Ext.grid.Panel', alias:'widget.userList', title:'Contacts', region:'center', resizable:true, initComponent: function() { this.store = 'UserStore'; this.columns = [ {text: 'Name',flex:1,sortable: true,dataIndex: 'name'}, {text: 'Age',flex:1,sortable: true,dataIndex: 'age'}, {text: 'Phone',flex:1,sortable: true,dataIndex: 'phone'}, {text: 'Email',flex:1,sortable: true,dataIndex: 'email'} ]; this.callParent(arguments); } }); In fire bug it shows the JSON response as follows: [{ "name": "Aswini", "age": "32", "phone": "555-555-5555", "email": "[email protected]" }] Why the Data has not been displayed although I have a valid json response. Please help!!!

    Read the article

  • ul sortables get serialized data

    - by russp
    Hi folks Any ideas how to get the serilized data from this function? the html is first with the JQuery function last, I cannot get the serialization to appear in the alert. When I can do that I can finish this by sending via ajax etc... <div class="column" id="col1"> <div class="portlet"> <div class="portlet-header">Feeds</div> <div class="portlet-content">Lorem ipsum dolor sit amet, consectetuer adipiscing elit</div> </div> <div class="portlet"> <div class="portlet-header">News</div> <div class="portlet-content">Lorem ipsum dolor sit amet, consectetuer adipiscing elit</div> </div> Shopping Lorem ipsum dolor sit amet, consectetuer adipiscing elit Links Lorem ipsum dolor sit amet, consectetuer adipiscing elit Images Lorem ipsum dolor sit amet, consectetuer adipiscing elit $(function() { $("#col1, #col2, #col3").sortable({ connectWith: '.column', receive : function () { serial = $('#col1').sortable('serialize'); //serial2 = $('#col2').sortable('serialize'); //serial3 = $('#col3').sortable('serialize'); alert(serial); } }); });

    Read the article

  • How to extend a jquery ui widget ? (1.7)

    - by Jide
    I would like to create a custom version of the sortable widget. I have been searching for documentation, but could not find something really accurate. The best information I found was : http://jqueryui.pbworks.com/Widget-factory. I tried : $.widget("ui.customsortable", $.extend($.ui.sortable, { _init: function() { $.widget.prototype._init.apply(this, arguments); } })); But $.widget.prototype._init is not the function I want to call I guess since it is the $.widget prototype. Then, I tried something I read here and there : var _init = $.ui.sortable.prototype._init; $.widget("ui.customsortable", $.extend($.ui.sortable, { _init: function() { _init.apply(this, arguments); }, })); But : I can't believe I have to store all methods I want to override like this, it is so ugly. It throws an error ("this.refresh is not a function"), which means the refresh method does not exist. Does that mean I would have to recreate all methods I want to override ? What's the point of extending in that case ? Am I missing something here ? Thanks for your help !

    Read the article

  • Not delete params in URL, when sorting [ RAILS 3 ]

    - by kamil
    I have sortable table columns, made like that http://asciicasts.com/episodes/228-sortable-table-columns And I have simply filter options for two columns in table, made at select_tag (GET method). This two function don't work together. When I change filter, the sort parameter disappear and inversely. <th><%= sortable "Id" %></th> <th> Status<br/> <form method="get"> <%= select_tag(:status, options_for_select([['All', 'all']]+@statuses, params[:status]),{:onchange => 'this.form.submit()'}) %> </th> <th><%= sortable "Operation" %></th> <th> Processor<br/> <%= select_tag(:processor, options_for_select([['All', 'all']]+@processor_names, params[:processor]),{:onchange => 'this.form.submit()'}) %> </form> </th>

    Read the article

  • Getting 'sections.each is not a function' with javascript / scriptaculous

    - by tonyyeb
    Hi all Trying an example piece of code for scriptaculous for doing some drag and drop. It works fine in IE8 but Firefox and Chrome generate an error of 'sections.each is not a function' Here is the code: function getGroupOrder() { var sections = document.getElementsByClassName('section'); var alerttext = ''; sections.each(function(section) { var sectionID = section.id; var order = Sortable.serialize(sectionID); var mySectionID = Right(section.id); var myLen = String(Sortable.sequence(section)).length; var StuCode = ""; if (myLen ==8) {var StuCode = String(Sortable.sequence(section)).substring(myLen, 2);} else if (myLen ==9) {var StuCode = String(Sortable.sequence(section)).substring(myLen, 3);} alerttext += mySectionID + ': ' + StuCode + '\n'; alerttextb = sectionID + ': ' + StuCode + '\n'; } } One solution suggested on a forum "I was able to resolve this issue by wrapping the call to document.getElementsByClassName('section'); with $A()" but I don't have a clue what that means! I asked what it meant but the post was made in 2008 and no reply as yet. Thanks for any help provided. Regards

    Read the article

  • jQueryUI Ajax.NET Postback Bug

    - by nigative
    Hi, I have this ASP.NET page with ASP.NET UpdatePanel and jQueryUI droppable and sortable components. The page works fine in all browsers, but doesn't in Internet Explorer (IE8 tested). After I try to call ASP.NET AJAX event (by pressing my asp.net button inside the UpdatePanel) my sortable list stops working properly inside IE browser and the browser throws the following error: Message: Unspecified error. Line: 145 Char: 186 Code: 0 URI: http://code.jquery.com/jquery-1.4.2.min.js I found out that the problem is caused by the code on line 66: $("#droppable").droppable(); If I comment it out, the sortable list works fine after ajax postbacks. But it doesn't make sense. Does anyone know what could be wrong? Thanks. P.S. I am using jQueryUI 1.8.1 and jQuery 1.4.2

    Read the article

  • When Drag a object from one div to another , format gets changed

    - by Anuj
    When a object is dragged and dropped from one div to another, the format in li gets changes to text only. I want it in the same format i.e 'li' after droping it. $(function() { $( "#catalog ul" ).sortable({ zIndex: 10000, revert: true }); $( "#catalog" ).accordion(); $( "#catalog ul" ).draggable({ appendTo: "body", helper: "clone", zIndex: 10000 }); $( "#dialogIteration ol" ).droppable({ activeClass: "ui-state-default", hoverClass: "ui-state-hover", drop: function( event, ui ) { $( this ).find( ".placeholder" ).remove(); $( "<li></li>" ).text( ui.draggable.text() ).appendTo( this ); } }).sortable({ items: "li:not(.placeholder)", sort: function() { // gets added unintentionally by droppable interacting with sortable // using connectWithSortable fixes this, but doesn't allow you to customize active/hoverClass options $( this ).removeClass( "ui-state-default" ); } }); $( "ul, li" ).disableSelection(); $("#dialogIteration").dialog(); }); Demo: http://jsfiddle.net/coolanuj/7683X/7/

    Read the article

  • Search function fails because it refers to the wrong controller action?

    - by Christoffer
    My Sunspot search function (sunspot_rails gem) works just fine in my index view, but when I duplicate it to my show view my search breaks... views/supplierproducts/show.html.erb <%= form_tag supplierproducts_path, :method => :get, :id => "supplierproducts_search" do %> <p> <%= text_field_tag :search, params[:search], placeholder: "Search by SKU, product name & EAN number..." %> </p> <div id="supplierproducts"><%= render 'supplierproducts' %></div> <% end %> assets/javascripts/application.js $(function () { $('#supplierproducts th a').live('click', function () { $.getScript(this.href); return false; } ); $('#supplierproducts_search input').keyup(function () { $.get($("#supplierproducts_search").attr("action"), $("#supplierproducts_search").serialize(), null, 'script'); return false; }); }); views/supplierproducts/show.js.erb $('#supplierproducts').html('<%= escape_javascript(render("supplierproducts")) %>'); views/supplierproducts/_supplierproducts.hmtl.erb <%= hidden_field_tag :direction, params[:direction] %> <%= hidden_field_tag :sort, params[:sort] %> <table class="table table-bordered"> <thead> <tr> <th><%= sortable "sku", "SKU" %></th> <th><%= sortable "name", "Product name" %></th> <th><%= sortable "stock", "Stock" %></th> <th><%= sortable "price", "Price" %></th> <th><%= sortable "ean", "EAN number" %></th> </tr> </thead> <% for supplierproduct in @supplier.supplierproducts %> <tbody> <tr> <td><%= supplierproduct.sku %></td> <td><%= supplierproduct.name %></td> <td><%= supplierproduct.stock %></td> <td><%= supplierproduct.price %></td> <td><%= supplierproduct.ean %></td> </tr> </tbody> <% end %> </table> controllers/supplierproducts_controller.rb class SupplierproductsController < ApplicationController helper_method :sort_column, :sort_direction def show @supplier = Supplier.find(params[:id]) @search = @supplier.supplierproducts.search do fulltext params[:search] end @supplierproducts = @search.results end end private def sort_column Supplierproduct.column_names.include?(params[:sort]) ? params[:sort] : "name" end def sort_direction %w[asc desc].include?(params[:direction]) ? params[:direction] : "asc" end models/supplierproduct.rb class Supplierproduct < ActiveRecord::Base attr_accessible :ean, :name, :price, :sku, :stock, :supplier_id belongs_to :supplier validates :supplier_id, presence: true searchable do text :ean, :name, :sku end end Visiting show.html.erb works just fine. Log shows: Started GET "/supplierproducts/2" for 127.0.0.1 at 2012-06-24 13:44:52 +0200 Processing by SupplierproductsController#show as HTML Parameters: {"id"=>"2"} Supplier Load (0.1ms) SELECT "suppliers".* FROM "suppliers" WHERE "suppliers"."id" = ? LIMIT 1 [["id", "2"]] SOLR Request (252.9ms) [ path=#<RSolr::Client:0x007fa5880b8e68> parameters={data: fq=type%3ASupplierproduct&start=0&rows=30&q=%2A%3A%2A, method: post, params: {:wt=>:ruby}, query: wt=ruby, headers: {"Content-Type"=>"application/x-www-form-urlencoded; charset=UTF-8"}, path: select, uri: http://localhost:8982/solr/select?wt=ruby, open_timeout: , read_timeout: } ] Supplierproduct Load (0.2ms) SELECT "supplierproducts".* FROM "supplierproducts" WHERE "supplierproducts"."id" IN (1) Supplierproduct Load (0.1ms) SELECT "supplierproducts".* FROM "supplierproducts" WHERE "supplierproducts"."supplier_id" = 2 Rendered supplierproducts/_supplierproducts.html.erb (2.2ms) Rendered supplierproducts/show.html.erb within layouts/application (3.3ms) Rendered layouts/_shim.html.erb (0.0ms) User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."remember_token" = 'zMrtTbDun2MjMHRApSthCQ' LIMIT 1 Rendered layouts/_header.html.erb (2.1ms) Rendered layouts/_footer.html.erb (0.2ms) Completed 200 OK in 278ms (Views: 20.6ms | ActiveRecord: 0.6ms | Solr: 252.9ms) But it breaks when I type in a search. Log shows: Started GET "/supplierproducts?utf8=%E2%9C%93&search=a&direction=&sort=&_=1340538830635" for 127.0.0.1 at 2012-06-24 13:53:50 +0200 Processing by SupplierproductsController#index as JS Parameters: {"utf8"=>"?", "search"=>"a", "direction"=>"", "sort"=>"", "_"=>"1340538830635"} Rendered supplierproducts/_supplierproducts.html.erb (2.4ms) Rendered supplierproducts/index.js.erb (2.9ms) Completed 500 Internal Server Error in 6ms ActionView::Template::Error (undefined method `supplierproducts' for nil:NilClass): 10: <th><%= sortable "ean", "EAN number" %></th> 11: </tr> 12: </thead> 13: <% for supplierproduct in @supplier.supplierproducts %> 14: <tbody> 15: <tr> 16: <td><%= supplierproduct.sku %></td> app/views/supplierproducts/_supplierproducts.html.erb:13:in `_app_views_supplierproducts__supplierproducts_html_erb___2251600857885474606_70174444831200' app/views/supplierproducts/index.js.erb:1:in `_app_views_supplierproducts_index_js_erb___1613906916161905600_70174464073480' Rendered /Users/Computer/.rvm/gems/ruby-1.9.3-p194@myapp/gems/actionpack-3.2.3/lib/action_dispatch/middleware/templates/rescues/_trace.erb (33.3ms) Rendered /Users/Computer/.rvm/gems/ruby-1.9.3-p194@myapp/gems/actionpack-3.2.3/lib/action_dispatch/middleware/templates/rescues/_request_and_response.erb (0.9ms) Rendered /Users/Computer/.rvm/gems/ruby-1.9.3-p194@myapp/gems/actionpack-3.2.3/lib/action_dispatch/middleware/templates/rescues/template_error.erb within rescues/layout (39.7ms)

    Read the article

  • jquery-ui - position of a list item when starting drag and drop?

    - by user246114
    Hi, I am using the jquery-ui library. I have two sortables. I want to know the index of the dragged source item. I have something like this: $(function() { $("#sortable1, #sortable2").sortable({ connectWith: '.connectedSortable' }).disableSelection(); $("#sortable1").sortable({ start: function(event, ui) { alert(ui.position); } }); }); if I'm reading the docs correctly, then ui.position should be what I want?: ui.position - current position of the helper but when I jsut try printing it: alert(ui.position) it seems to be empty. I am doing all of this in an attempt to emulate cloning. docs: http://jqueryui.com/demos/sortable/#event-activate Thanks

    Read the article

  • How do customize the g:sortableColumn?

    - by kakaotalk
    Well, I have one column in my list that I need to customize, the thing is grails' own g:sortable doesn't work. For instance, my first column shows employee ids, then my second column, shows the employees full name where full name is a combination of first name and last name. I got it to work, sorting and all, but when I try to place it in a table with g:sortable, the g:sortable just wouldn't work. I'm thinking about passing params around but it's a bit tricky. Any suggestions? I've looked around the internet, and seems like nothing. :\

    Read the article

  • Javascript not able to read data generated by ajax script

    - by user1371033
    I have a situation in which my Jquery Ajax script generates HTML table. And another script is meant to filter the table column by providing a dropdown comprising of unique values in that particular column. If i have static content in html page the filter script works fine. But is not able to read table content when it is generated via Ajax that is during runtime. Any idea what could be the reason. I also tried to align script in order. My Ajax script is here:- $(document).ready(function() { $("#getResults").click(function(){ bug = $("#bug").val(); priority = $("#priority").val(); component = $("#component").val(); fixVersion = $("#fixVersion").val(); dateType = $("#dateType").val(); fromDate = $("#dp2").val(); toDate = $("#dp3").val(); $("#query").empty(); $("tbody").empty(); $.post("getRefineSearchResultsPath", {bug:bug,priority:priority,component:component, fixVersion:fixVersion,dateType:dateType,fromDate:fromDate,toDate:toDate }, function(data) { // setting value for csv report button //clear the value attribute for button first $("#query_csv").removeAttr("value"); //setting new value to "value" attribute of the csv button $("#query_csv").attr("value", function(){ return $(data).find("query").text(); }); $("#query").append("<p class='text-success'>Query<legend></legend><small>" +$(data).find("query").text() +"</small></p>"); var count = 1; $(data).find("issue").each(function(){ var $issue = $(this); var value = "<tr>"; value += "<td>" +count +"</td>"; value += "<td>" +$issue.find('issueKey').text() +"</td>"; value += "<td>" +$issue.find('type').text() +"</td>"; value += "<td><div id='list' class='summary'>" +$issue.find('summary').text() +"</div></td>"; value += "<td><div id='list' class='mousescroll'>" +$issue.find('description').text() +"</div></td>"; value += "<td>" +$issue.find('priority').text() +"</td>"; value += "<td>" +$issue.find('component').text() +"</td>"; value += "<td>" +$issue.find('status').text() +"</td>"; value += "<td>" +$issue.find('fixVersion').text() +"</td>"; value += "<td>" +$issue.find('resolution').text() +"</td>"; value += "<td>" +$issue.find('created').text() +"</td>"; value += "<td>" +$issue.find('updated').text() +"</td>"; value += "<td>" +$issue.find('os').text() +"</td>"; value += "<td>" +$issue.find('frequency').text() +"</td>"; value += "<td>"; var number_of_attachement = $issue.find('attachment').size(); if(number_of_attachement > 0){ value += "<div id='list' class='attachment'>"; value += "<ul class='unstyled'>"; $issue.find('attachment').each(function(){ var $attachment = $(this); value += "<li>"; value += "<a href='#' onclick='document.f1.attachmentName.value='" +$attachment.find('attachmentName').text(); value += "';document.f1.issueKey.value='"+$attachment.find('attachmentissueKey').text(); value += "';document.f1.digest.value='"+$attachment.find('attachmentdigest').text(); value += "';document.f1.submit();'>"+$attachment.find('attachmentName').text(); value += "</a>"; value += "</li>"; value += "<br>"; }); value +="</ul>"; value +="</div>"; } value += "</td>"; value += "</tr>"; $("tbody").append(value); count++; }); }); }); }); And my script to filter table is here, I got this script from this link http://www.javascripttoolbox.com/lib/table/ My JSP page is here:- <html> <body> <table class="table table-bordered table-condensed table-hover example sort01 table-autosort:0 table-autofilter table-autopage:10 table-page-number:t1page table-page-count:t1pages table-filtered-rowcount:t1filtercount table-rowcount:t1allcount"> <thead > <tr> <th class="table-sortable:numeric" Style="width:3%;">No.</th> <th class="table-sortable:default" Style="width:5.5%;">Issue Key <br> </th> <th>Type</th> <th Style="text-align: center;">Summary</th> <th Style="text-align: center;">Description</th> <th class="table-filterable table-sortable:default" id ="priorityColumn" Style="width:5%">Priority</th> <th class="table-filterable table-sortable:default" >Component</th> <th class="table-filterable table-sortable:default" Style="width:5%">Status</th> <th class="table-filterable table-sortable:default">Fix Version</th> <th class="table-filterable table-sortable:default" Style="width:6%">Resolution</th> <th>Created</th> <th>Updated</th> <th>OS</th> <th>Frequency</th> <th>Attachments</th> </tr> </thead> <tbody> </tbody> <tfoot> <tr> <td class="table-page:previous" style="cursor:pointer;"><img src="table/icons/previous.gif" alt="Previous"><small>Prev</small></td> <td colspan="13" style="text-align:center;">Page <span id="t1page"></span>&nbsp;of <span id="t1pages"></span></td> <td class="table-page:next" style="cursor:pointer;">Next <img src="table/icons/next.gif" alt="Previous"></td> </tr> <tr Style="background-color: #dddddd"> <td colspan="15"><span id="t1filtercount"></span>&nbsp;of <span id="t1allcount"></span>&nbsp;rows match filter(s)</td> </tr> <tr class="text-success"> <td colspan="15">Total Results : ${count}</td> </tr> </tfoot> </table> </body> </html>

    Read the article

  • Hi how to show the results in a datatable while we are using yui

    - by udaya
    Hi I am using yui to display a datagrid ... <?php $host = "localhost"; //database location $user = "root"; //database username $pass = ""; //database password $db_name = "cms"; //database name //database connection $link = mysql_connect($host, $user, $pass); mysql_select_db($db_name); //sets encoding to utf8 $result = mysql_query("select dStud_id,dMarkObtained1,dMarkObtained2,dMarkObtained3,dMarkTotal from tbl_internalmarkallot"); //$res = mysql_fetch_array($result); while($res = mysql_fetch_array($result)) { //print_r($res); $JsonVar = json_encode($res); echo "<input type='text' name='json' id='json' value ='$JsonVar'>"; } //print_r (mysql_fetch_array($result)); //echo "<input type='text' name='json' id='json' value ='$JsonVar'>"; ?> <html> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8"> <title>Client-side Pagination</title> <style type="text/css"> body { margin:0; padding:0; } </style> <link rel="stylesheet" type="text/css" href="build/fonts/fonts-min.css" /> <link rel="stylesheet" type="text/css" href="build/paginator/assets/skins/sam/paginator.css" /> <link rel="stylesheet" type="text/css" href="build/datatable/assets/skins/sam/datatable.css" /> <script type="text/javascript" src="build/yahoo-dom-event/yahoo-dom-event.js"></script> <script type="text/javascript" src="build/connection/connection-min.js"></script> <script type="text/javascript" src="build/json/json-min.js"></script> <script type="text/javascript" src="build/element/element-min.js"></script> <script type="text/javascript" src="build/paginator/paginator-min.js"></script> <script type="text/javascript" src="build/datasource/datasource-min.js"></script> <script type="text/javascript" src="build/datatable/datatable-min.js"></script> <script type="text/javascript" src="YuiJs.js"></script> <style type="text/css"> #paginated { text-align: center; } #paginated table { margin-left:auto; margin-right:auto; } #paginated, #paginated .yui-dt-loading { text-align: center; background-color: transparent; } </style> </head> <body class="yui-skin-sam" onload="ProjectDatatable(document.getElementById('json').value);"> <h1>Client-side Pagination</h1> <div class="exampleIntro"> </div> <input type="hidden" id="HfId"/> <div id="paginated"> </div> <script type="text/javascript"> /*YAHOO.util.Event.onDOMReady(function() { YAHOO.example.ClientPagination = function() { var myColumnDefs = [ {key:"dStud_id", label:"ID",sortable:true, resizeable:true, editor: new YAHOO.widget.TextareaCellEditor()}, {key:"dMarkObtained1", label:"Name",sortable:true}, {key:"dMarkObtained2", label:"CycleTest1"}, {key:"dMarkObtained3", label:"CycleTest2"}, {key:"dMarkTotal", label:"CycleTest3"}, ]; var myDataSource = new YAHOO.util.DataSource("assets/php/json_proxy.php?"); myDataSource.responseType = YAHOO.util.DataSource.TYPE_JSON; myDataSource.responseSchema = { resultsList: "records", fields: ["dStud_id","dMarkObtained1","dMarkObtained2","dMarkObtained3","dMarkTotal"] }; var oConfigs = { paginator: new YAHOO.widget.Paginator({ rowsPerPage: 15 }), initialRequest: "results=504" }; var myDataTable = new YAHOO.widget.DataTable("paginated", myColumnDefs, myDataSource, oConfigs); return { oDS: myDataSource, oDT: myDataTable }; }(); });*/ </script> <?php echo "m".$res['dMarkObtained1']; echo "m".$res['dMarkObtained2']; echo "m".$res['dMarkObtained3']; echo "Tm".$res['dMarkTotal']; {?><? }?> </body> </html> </body> </html> This is my page where i am fetching the data's from the database function generateDatatable(target, jsonObj, myColumnDefs, hfId) { var root; for (key in jsonObj) { root = key; break; } var rootId = "id"; if (jsonObj[root].length > 0) { for (key in jsonObj[root][0]) { rootId = key; break; } } YAHOO.example.DynamicData = function() { var myPaginator = new YAHOO.widget.Paginator({ rowsPerPage: 10, template: YAHOO.widget.Paginator.TEMPLATE_ROWS_PER_PAGE, rowsPerPageOptions: [5, 25, 50, 100], pageLinks: 10 }); // DataSource instance var myDataSource = new YAHOO.util.DataSource(jsonObj); myDataSource.responseType = YAHOO.util.DataSource.TYPE_JSON; myDataSource.responseSchema = { resultsList: root, fields: new Array() }; myDataSource.responseSchema.fields[0] = rootId; for (var i = 0; i < myColumnDefs.length; i++) { myDataSource.responseSchema.fields[i + 1] = myColumnDefs[i].key; } // DataTable configuration var myConfigs = { sortedBy: { key: myDataSource.responseSchema.fields[1], dir: YAHOO.widget.DataTable.CLASS_ASC }, // Sets UI initial sort arrow paginator: myPaginator }; // DataTable instance var myDataTable = new YAHOO.widget.DataTable(target, myColumnDefs, myDataSource, myConfigs); myDataTable.subscribe("rowMouseoverEvent", myDataTable.onEventHighlightRow); myDataTable.subscribe("rowMouseoutEvent", myDataTable.onEventUnhighlightRow); myDataTable.subscribe("rowClickEvent", myDataTable.onEventSelectRow); myDataTable.subscribe("checkboxClickEvent", function(oArgs) { var hidObj = document.getElementById(hfId); var elCheckbox = oArgs.target; var oRecord = this.getRecord(elCheckbox); var id = oRecord.getData(rootId); if (elCheckbox.checked) { if (hidObj.value == "") { hidObj.value = id; } else { hidObj.value += "," + id; } } else { hidObj.value = removeIdFromArray("" + hfId, id); } }); myPaginator.subscribe("changeRequest", function() { if (document.getElementById(hfId).value != "") { /*if (document.getElementById("ConfirmationPanel").style.display == 'block') { document.getElementById("ConfirmationPanel").style.display = 'none'; }*/ document.getElementById(hfId).value = ""; } return true; }); myDataTable.handleDataReturnPayload = function(oRequest, oResponse, oPayload) { oPayload.totalRecords = oResponse.meta.totalRecords; return oPayload; } return { ds: myDataSource, dt: myDataTable }; } (); } function removeIdFromArray(values, id) { values = document.getElementById(values).value; if (values.indexOf(',') == 0) { values = values.substring(1); } if (values.indexOf(values.length - 1) == ",") { values = values.substring(0, values.length - 1); } var ids = values.split(','); var rtnValue = ""; for (var i = 0; i < ids.length; i++) { if (ids[i] != id) { rtnValue += "," + ids[i]; } } if (rtnValue.indexOf(",") == 0) { rtnValue = rtnValue.substring(1); } return rtnValue; } function edityuitable() { var ErrorDiv = document.getElementById("ErrorDiv"); var editId=document.getElementById("ctl00_ContentPlaceHolder1_HfId").value; if(editId.length == 0) { ErrorDiv.innerHTML = getErrorMsgStyle("Select a row for edit"); //alert("Select a row for edit"); return false; } else { var editarray = editId.split(","); if (editarray.length != 1) { ErrorDiv.innerHTML = getErrorMsgStyle("Select One row for edit"); //alert("Select One row for edit"); return false; } else if (editarray.length == 1) { return true; } } } function Deleteyuitable() { var ErrorDiv = document.getElementById("ErrorDiv"); var editId=document.getElementById("ctl00_ContentPlaceHolder1_HfId").value; if(editId.length == 0) { ErrorDiv.innerHTML = getErrorMsgStyle("Select a row for Delete"); return false; } else { return true; } } function ProjectDatatable(HfJsonValue){ alert(HfJsonValue); var myColumnDefs = [ {key:"dStud_id", label:"ID", width:150, sortable:true, sortOptions:{defaultDir:YAHOO.widget.DataTable.CLASS_DESC}}, {key:"dMarkObtained1", label:"Marks", width:200, sortable:true, sortOptions:{defaultDir:YAHOO.widget.DataTable.CLASS_DESC}}, {key:"dMarkObtained2", label:"Marks1", width:150, sortable:true, sortOptions:{defaultDir:YAHOO.widget.DataTable.CLASS_DESC}}, {key:"dMarkObtained3", label:"Marks2", width:200, sortable:true, sortOptions:{defaultDir:YAHOO.widget.DataTable.CLASS_DESC}}, {key:"dMarkTotal", label:"Total", width:150, sortable:true, sortOptions:{defaultDir:YAHOO.widget.DataTable.CLASS_DESC}}, {key:"", formatter:"checkbox"} ]; var jsonObj=eval('(' + HfJsonValue + ')'); var target = "paginated"; var hfId = "HfId"; generateDatatable(target,jsonObj,myColumnDefs,hfId) } // JavaScript Document This is my script page when i load the page i do get the first row from the database but the consequtive data's are not displayed in the alert box how can i receieve the data's in the datagrid

    Read the article

  • ActionLink Problem with Client Template Telerik MVC grid

    - by Tassadaque
    Hi, i m using Telerik grid to present memos received by user below is the code <%Html.Telerik().Grid<UserManagement.Models.SentMemos>() .Name("ReceivedMemos") .Sortable(sorting => sorting .OrderBy(sortOrder => sortOrder.Add(o => o.MemoDate).Descending())) .DataBinding(dataBinding => dataBinding //Ajax binding .Ajax() //The action method which will return JSON .Select("_AjaxBindingReceivedMemos", "OA" ) ). Columns(colums => { colums.Bound(o => o.MemoID).ClientTemplate(Html.ActionLink("Reply", "ReplyMemo", "OA", new { MemoID = "<#=MemoID#>"}, null).ToString()).Title("Reply").Filterable(false).Sortable(false); colums.Bound(o => o.MemoID).ClientTemplate(Html.ActionLink("Acknowledge", "PreviewMemo", "OA", new { id = "<#=MemoID#>"}, null).ToString()).Title("Acknowledge").Filterable(false).Sortable(false); colums.Bound(o => o.Subject).ClientTemplate(Html.ActionLink("<%#=Subject#>", "PreviewMemo", "OA", new { id = "<#=MemoID#>" }, null).ToString()).Title("Subject"); //colums.Bound(o => Html.ActionLink(o.Subject,"PreviewMemo","OA",new{id=o.MemoID},null).ToString()).Title("Subject"); colums.Bound(o => o.FromEmployeeName); colums.Bound(o => o.MemoDate); }) .Sortable() .Filterable() .RowAction((row) => { row.HtmlAttributes.Add("style", "background:#321211;"); }) .Pageable(pager=>pager.PageSize(6)) .PrefixUrlParameters(false) //.ClientEvents(events => events.OnRowDataBound("onRowDataBound")) .Render(); %> where i m binding third column (Subject) my intention is to make an ActionLink where subject is the display text and i want a dynamic ID coming from <#=MemoID#. memo id is working fine and gives me a link with dynamic Memo IDs. the problem is with the subject i.e ("<#=Subject#") is rendered as it is on the screen without mapping to the actual subject of the memo. i have also tried ("<%#=Subject%") but to no gain. any help is highly appriciated regards

    Read the article

  • Displaytag table exported header column contains span tags

    - by Lancelot
    Hi, When I export the content of the display tag table I use the data shows up fine, but the header cells are surrounded by html span tags, which is slightly annoying. I can imagine why Displaytag uses spans around the column header's text, but it shouldn't transpose in the exported data I think. Here is my displaytag.properties config related to export: # Export export.amount = list export.decorated = true export.banner=<div id="exportTypes"><span class="label">Export: </span>{0}</div> export.banner.sepchar=&nbsp;| export.types=excel csv xml export.excel=true export.csv=true export.xml=false export.excel.label=xls export.csv.label=csv export.xml.label=xml export.excel.filename=export.xls export.csv.filename=export.csv export.xml.filename=export.xml export.excel.include_header=true export.csv.include_header=true export.xml.include_header=true Here is the displaytag table itself: <display:table class="list sortable" defaultsort="1" export="true" htmlId="contacts" id="row" name="contacts" requestURI=""> <display:setProperty name="export.banner"><div id="exportTypes"><span class="label">Export:</span> {0}</div></display:setProperty> <display:setProperty name="export.csv.filename">CSV</display:setProperty> <display:setProperty name="export.excel.filename">XLS</display:setProperty> <display:setProperty name="basic.msg.empty_list_row"> <tr class="empty"> <td colspan="7">Empty</td> </tr> </display:setProperty> <display:column class="lastName" property="lastName" sortProperty="lastName" headerClass="lastName first" sortable="true" titleKey="Lastname" href="contact/view" paramId="contactId" paramProperty="id" /> <display:column property="firstName" class="firstName" headerClass="firstName" sortable="true" titleKey="FirstName" /> <display:column class="loginName" headerClass="loginName" sortable="true" titleKey="Username" /> </display:table> My problem is when I click export on either the CSV or the XLS format the header row in the generated file looks like this: <span>Last Name</span> <span>First Name</span> <span>Username</span> I really don't want those span tags in there, any way to work around that? Thanks

    Read the article

  • Dojo - How to position tooltip close to text?

    - by user244394
    Like the title says i want to be able to display the tooltip close to the text, currently it is displayed far away in the cell. Tobe noted the tooltip positions correctly for large text, only fails for small text. In DOJO How can i position the tooltip close to the text? I have this bit of code snippet that display the tooltip in the grid cells. Screenshot attached, html <div class="some_app claro"></div> ... com.c.widget.EnhancedGrid = function ( aParent, options ) { var grid, options; this.theParentApp = aParent; dojo.require("dojox.grid.EnhancedGrid"); dojo.require("dojox.grid.enhanced.plugins.Menu"); dojo.require("dojox.grid.enhanced.plugins.Selector"); dojo.require("dojox.grid.enhanced.plugins.Pagination"); dojo.require("dojo.store.Memory"); dojo.require("dojo.data.ObjectStore"); dojo.require("dojo._base.xhr"); dojo.require("dojo.domReady!"); dojo.require("dojo.date.locale"); dojo.require("dojo._base.connect"); dojo.require("dojox.data.JsonRestStore"); dojo.require("dojo.data.ItemFileReadStore"); dojo.require("dijit.Menu"); dojo.require("dijit.MenuItem"); dojo.require('dijit.MenuSeparator'); dojo.require('dijit.CheckedMenuItem'); dojo.require('dijit.Tooltip'); dojo.require('dojo/query'); dojo.require("dojox.data.QueryReadStore"); // main initialization function this.init = function( options ) { var me = this; // default options var defaultOptions = { widgetName: ' Enhancedgrid', render: true, // immediately render the grid draggable: true, // disables column dragging containerNode: false, // the Node to hold the Grid (optional) mashupUrl: false, // the URL of the mashup (required) rowsPerPage: 20, //Default number of items per page columns: false, // columns (required) width: "100%", // width of grid height: "100%", // height of grid rowClass: function (rowData) {}, onClick: function () {}, headerMenu: false, // adding a menu pop-up for the header. selectedRegionMenu: false, // adding a menu pop-up for the rows. menusObject: false, //object to start-up the menus using the plug-in. sortInfo: false, // The column default sort infiniteScrolling: false //If true, the enhanced grid will have an infinite scrolling. }; // merge user provided options me.options = jQuery.extend( {}, defaultOptions, options ); // check we have minimum required options if ( ! me.options.mashupUrl ){ throw ("You must supply a mashupUrl"); } if ( ! me.options.columns ){ throw ("You must supply columns"); } // make the column for formatting based on its data type. me.preProcessColumns(); // create the Contextual Menu me.createMenu(); // create the grid object and return me.createGrid(); }; // Loading the data to the grid. this.loadData = function () { var me = this; if (!me.options.infiniteScrolling) { var xhrArgs = { url: me.options.mashupUrl, handleAs: "json", load: function( data ){ var store = new dojo.data.ItemFileReadStore({ data : {items : eval( "data."+me.options.dataRoot)}}); store.fetch({ onComplete : function(items, request) { if (me.grid.selection !== null) { me.grid.selection.clear(); } me.grid.setStore(store); }, onError : function(error) { me.onError(error); } }); }, error: function (error) { me.onError(error); } }; dojo.xhrGet(xhrArgs); } else { dojo.declare('NotificationQueryReadStore', dojox.data.QueryReadStore, { // // hacked -- override to map to proper data structure // from mashup // _xhrFetchHandler : function(data, request, fetchHandler, errorHandler) { // // TODO: need to have error handling here when // data has "error" data structure // // // remap data object before process by super method // var dataRoot = eval ("data."+me.options.dataRoot); var dataTotal = eval ("data."+me.options.dataTotal); data = { numRows : dataTotal, items : dataRoot }; // call to super method to process mapped data and // set rowcount // for proper display this.inherited(arguments); } }); var queryStore = new NotificationQueryReadStore({ url : me.options.mashupUrl, urlPreventCache: true, requestMethod : "get", onError: function (error) { me.onError(error); } }); me.grid.setStore(queryStore); } }; this.preProcessColumns = function () { var me = this; var options = me.options; for (i=0;i<this.options.columns.length;i++) { if (this.options.columns[i].formatter==null) { switch (this.options.columns[i].datatype) { case "string": this.options.columns[i].formatter = me.formatString; break; case "date": this.options.columns[i].formatter = me.formatDate; var todayDate = new Date(); var gmtTime = c.util.Date.parseDate(todayDate.toString()).toString(); var gmtval = gmtTime.substring(gmtTime.indexOf('GMT'),(gmtTime.indexOf('(')-1)); this.options.columns[i].name = this.options.columns[i].name + " ("+gmtval+")"; } } if (this.options.columns[i].sortDefault) { me.options.sortInfo = i+1; } } }; // create GRID object using supplied options this.createGrid = function () { var me = this; var options = me.options; // create a new grid this.grid = new dojox.grid.EnhancedGrid ({ width: options.width, height: options.height, query: { id: "*" }, keepSelection: true, formatterScope: this, structure: options.columns, columnReordering: options.draggable, rowsPerPage: options.rowsPerPage, //sortInfo: options.sortInfo, plugins : { menus: options.menusObject, selector: {"row":"multi", "cell": "disabled" }, }, //Allow the user to decide if a column is sortable by setting sortable = true / false canSort: function(col) { if (options.columns[Math.abs(col)-1].sortable) return true; else return false; }, //Change the row colors depending on severity column. onStyleRow: function (row) { var grid = me.grid; var item = grid.getItem(row.index); if (item && options.rowClass(item)) { row.customClasses += " " +options.rowClass(item); if (grid.selection.selectedIndex == row.index) { row.customClasses += " dojoxGridRowSelected"; } grid.focus.styleRow(row); grid.edit.styleRow(row); } }, onCellMouseOver: function (e){ // var pos = dojo.position(this, true); // alert(pos); console.log( e.rowIndex +" cell node :"+ e.cellNode.innerHTML); // var pos = dojo.position(this, true); console.log( " pos :"+ e.pos); if (e.cellNode.innerHTML!="") { dijit.showTooltip(e.cellNode.innerHTML, e.cellNode); } }, onCellMouseOut: function (e){ dijit.hideTooltip(e.cellNode); }, onHeaderCellMouseOver: function (e){ if (e.cellNode.innerHTML!="") { dijit.showTooltip(e.cellNode.innerHTML, e.cellNode); } }, onHeaderCellMouseOut: function (e){ dijit.hideTooltip(e.cellNode); }, }); // ADDED CODE FOR TOOLTIP var gridTooltip = new Tooltip({ connectId: "grid1", selector: "td", position: ["above"], getContent: function(matchedNode){ var childNode = matchedNode.childNodes[0]; if(childNode.nodeType == 1 && childNode.className == "user") { this.position = ["after"]; this.open(childNode); return false; } if(matchedNode.className && matchedNode.className == "user") { this.position = ["after"]; } else { this.position = ["above"]; } return matchedNode.textContent; } }); ... //Construct the grid this.buildGrid = function(){ var datagrid = new com.emc.widget.EnhancedGrid(this,{ Url: "/dge/api/-resultFormat=json&id="+encodeURIComponent(idUrl), dataRoot: "Root.ATrail", height: '100%', columns: [ { name: 'Time', field: 'Time', width: '20%', datatype: 'date', sortable: true, searchable: true, hidden: false}, { name: 'Type', field: 'Type', width: '20%', datatype: 'string', sortable: true, searchable: true, hidden: false}, { name: 'User ID', field: 'UserID', width: '20%', datatype: 'string', sortable: true, searchable: true, hidden: false } ] }); this.grid = datagrid; };

    Read the article

  • dojo dgrid tree, subrows in wrong position

    - by Ventura
    I have a dgrid, working with tree column plugin. Every time that the user click on the tree, I call the server, catch the subrows(json) and bind it. But when it happens, these subrows are show in wrong position, like the image bellow. The most strange is when I change the pagination, after go back to first page, the subrows stay on the correct place. (please, tell me if is possible to understand my english, then I can try to improve the text) My dgrid code: var CustomGrid = declare([OnDemandGrid, Keyboard, Selection, Pagination]); var grid = new CustomGrid({ columns: [ selector({label: "#", disabled: function(object){ return object.type == 'DOCx'; }}, "radio"), {label:'Id', field:'id', sortable: false}, tree({label: "Title", field:"title", sortable: true, indentWidth:20, allowDuplicates:true}), //{label:'Title', field:'title', sortable: false}, {label:'Count', field:'count', sortable: false} ], store: this.memoryStore, collapseOnRefresh:true, pagingLinks: false, pagingTextBox: true, firstLastArrows: true, pageSizeOptions: [10, 15, 25], selectionMode: "single", // for Selection; only select a single row at a time cellNavigation: false // for Keyboard; allow only row-level keyboard navigation }, "grid"); My memory store: loadMemoryStore: function(items){ this.memoryStore = Observable(new Memory({ data: items, getChildren: function(parent, options){ return this.query({parent: parent.id}, options); }, mayHaveChildren: function(parent){ return (parent.count != 0) && (parent.type != 'DOC'); } })); }, This moment I am binding the subrows: success: function(data){ for(var i=0; i<data.report.length; i++){ this.memoryStore.put({id:data.report[i].id, title:data.report[i].created, type:'DOC', parent:this.designId}); } }, I was thinking, maybe every moment that I bind the subrows, I could do like a refresh on the grid, maybe works. I think that the pagination does the same thing. Thanks. edit: I forgot the question. Well, How can I correct this bug? If The refresh in dgrid works. How can I do it? Other thing that I was thinking, maybe my getChildren is wrong, but I could not identify it. thanks again.

    Read the article

  • ExtJs - Set a fixed width in a center layout in a Panel

    - by Benjamin
    Hi all, Using ExtJs. I'm trying to design a main which is divided into three sub panels (a tree list, a grid and a panel). The way it works is that you have a tree list (west) with elements, you click on an element which populates the grid (center), then you click on an element in the grid and that generates the panel (west). My main panel containing the three other ones has been defined with a layout 'border'. Now the problem I face is that the center layout (the grid) has been defined in the code with a fixed width and the west panel as an auto width. But when the interface gets generated, the grid width is suddenly taking all the space in the interface instead of the west panel. The code looks like that: var exploits_details_panel = new Ext.Panel({ region: 'east', autoWidth: true, autoScroll: true, html: 'test' }); var exploit_commands = new Ext.grid.GridPanel({ store: new Ext.data.Store({ autoDestroy: true }), sortable: true, autoWidth: false, region: 'center', stripeRows: true, autoScroll: true, border: true, width: 225, columns: [ {header: 'command', width: 150, sortable: true}, {header: 'date', width: 70, sortable: true} ] }); var exploits_tree = new Ext.tree.TreePanel({ border: true, region: 'west', width: 200, useArrows: true, autoScroll: true, animate: true, containerScroll: true, rootVisible: false, root: {nodeType: 'async'}, dataUrl: '/ui/modules/select/exploits/tree', listeners: { 'click': function(node) { } } }); var exploits = new Ext.Panel({ id: 'beef-configuration-exploits', title: 'Auto-Exploit', region: 'center', split: true, autoScroll: true, layout: { type: 'border', padding: '5', align: 'left' }, items: [exploits_tree, exploit_commands, exploits_details_panel] }); Here 'var exploits' is my main panel containing the three other sub panels. The 'exploits_tree' is the tree list containing some elements. When you click on one of the elements the grid 'exploit_commands' gets populated and when you click in one of the populated elements, the 'exploits_details_panel' panel gets generated. How can I set a fixed width on 'exploit_commands'? Thanks for your time.

    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

  • how to show a large jpg image to the right in jqGrid's edit form ?

    - by cLee
    Is it possible to show a large (i.e. bigger than a thumbnail) jpeg image in the right-hand side of jqGrid's edit form ? Users want to look at a photo while entering data into fields ... they are describing things in the photo. I'm sure all things are possible with jQuery, but I don't know where to begin. thanks ... html: function afterSubmit(r, data, action) { // if session timeout returned: if (r.responseText == "logout") { window.location = '../scripts/logout.php'; } // if an error message is returned: if (r.responseText != "") { $('#submit_errors').html('Alert:'+r.responseText+''); // show div with error message $('#submit_errors').slideDown(); // hide error div after 10 seconds window.setTimeout(function() { $('#submit_errors').slideUp(); }, 10000); return false; // don't remove this! } return true; // don't remove this! } var lastsel; jQuery(document).ready(function(){ var mygrid = jQuery("#mobile_incidents").jqGrid({ url:'list.php?q=e', editurl:'edit.php', datatype: "json", // note: all column names are required even though some columns are hidden colNames:['Rec#','Date','Line','Photo'], colModel:[{ name:'id', index:'id', editable:true, editoptions: {readonly:'readonly'} }, { name:'mobile_discoveryDate', index:'mobile_discoveryDate', sortable:false, editable:true, edittype:'text', formatter:'date', formatoptions:{ srcformat:'Y/m/d', newformat:'m/d/Y' }, editoptions:{ size:12, maxlength:10, dataInit: function(element) { $(element).blur(); $(element).datepicker({dateFormat:'mm/dd/yyyy'}) } } }, { name:'mobile_lineName', index:'mobile_lineName', editable:true, sortable:false}, { name:'mobile_photo_name', index:'mobile_photo_name', editable:false, sortable:false} ], pager: '#mobile_incidents_pager', altRows: false, rowNum:10, rowList:[10,20], imgpath: '../include/images/jqgrid', viewrecords: true, emptyrecords:'No submissions found!', height: 260, sortname: 'id', sortorder: 'desc', gridview: true, scrollrows: true, autowidth: true, rownumbers: false, multiselect: false, subGrid:false, caption: '' }) .navGrid('#mobile_incidents_pager', // params: {add:false, edit:true, del:false, search:false, view:false, refresh:true, alertcap:' to edit:', alerttext:' . . . click on a row to highlight' }, // edit params: {top:50, left:5, editCaption: 'Edit Submission', bSubmit: 'Approve/Save', closeAfterEdit:true, afterSubmit:function(r,data){return afterSubmit(r,data,'edit');} }, {}, // add params {}, // delete params // search params: {multipleSearch: false}, // view params: {top: 150, left: 5, caption: 'View Mobile Rail Submission'} ); });

    Read the article

  • How do I set YUI2 paginator to select a page other than the first page?

    - by Jeremy Weathers
    I have a YUI DataTable (YUI 2.8.0r4) with AJAX pagination. Each row in the table links to a details/editing page and I want to link from that details page back to the list page that includes the record from the details page. So I have to a) offset the AJAX data correctly and b) tell YAHOO.widget.Paginator which page to select. According to my reading of the YUI API docs, I have to pass in the initialPage configuration option. I've attempted this, but it doesn't take (the data from AJAX is correctly offset, but the paginator thinks I'm on page 1, so clicking "next" takes me from e.g. page 6 to page 2. What am I not doing (or doing wrong)? Here's my DataTable building code: (function() { var columns = [ {key: "retailer", label: "Retailer", sortable: false, width: 80}, {key: "publisher", label: "Publisher", sortable: false, width: 300}, {key: "description", label: "Description", sortable: false, width: 300} ]; var source = new YAHOO.util.DataSource("/sales_data.json?"); source.responseType = YAHOO.util.DataSource.TYPE_JSON; source.responseSchema = { resultsList: "records", fields: [ {key: "url"}, {key: "retailer"}, {key: "publisher"}, {key: "description"} ], metaFields: { totalRecords: "totalRecords" } }; var LoadingDT = function(div, cols, src, opts) { LoadingDT.superclass.constructor.call( this, div, cols, src, opts); // hide the message tbody this._elMsgTbody.style.display = "none"; }; YAHOO.extend(LoadingDT, YAHOO.widget.DataTable, { showTableMessage: function(msg) { $('sales_table_overlay').clonePosition($('sales_table').down('table')). show(); }, hideTableMessage: function() { $('sales_table_overlay').hide(); } }); var table = new LoadingDT("sales_table", columns, source, { initialRequest: "startIndex=125&results=25", dynamicData: true, paginator: new YAHOO.widget.Paginator({rowsPerPage: 25, initialPage: 6}) }); table.handleDataReturnPayload = function(oRequest, oResponse, oPayload) { oPayload.totalRecords = oResponse.meta.totalRecords; return oPayload; }; })();

    Read the article

  • Symfony dynamic forms

    - by Asier
    Hi there, I started with a form, which is made by hand because of it's complexity (it's a javascript modified form, with sortable parts, etc). The problem is that now I need to do the validation, and it's a total mess to do it from scratch in the action using the sfValidator* classes. So, I am thinking to do it using sfForm so that my form validation and error handling can be done more easier and so I can reuse this form for the Edit and Create pages. The form is something like this: <form> <input name="form[year]"/> <textarea name="form[description]"></textarea> <div class="sortable"> <div class="item"> <input name="form[items][0][name]"/> <input name="form[items][0][age]"/> </div> <div class="item"> <input name="form[items][1][name]"/> <input name="form[items][1][age]"/> </div> </div> </form> The thing is that the sortable part of the form can be expanded from 2 to N elements on the client side. So that it has variable items quantity which can be reordered. How can I approach this problem? Any ideas are welcome, thank you. :)

    Read the article

  • Create serial number column in telerik mvc grid

    - by Jayaraj
    I could create a grid with telerik mvc <% Html.Telerik().Grid(Model) .Name("ProductGrid") .Columns(columns => { columns.Bound(h => h.ProductName).Width("34%"); columns.Bound(h => h.Description).Width("60%"); columns.Bound(h => h.ProductID).Format(Html.ImageLink("Edit", "Products", new { Id = "{0}" }, "/Content/images/icon_edit.gif", "", new { Id = "edit{0}" }, null).ToString()).Encoded(false).Title("").Sortable(false).Width("3%"); columns.Bound(h => h.ProductID).Format(Html.ImageLink("Delete", "Products", new { Id = "{0}" }, "/Content/images/icon_delete.gif", "", new { onclick = string.Format("return confirm('Are you sure to delete this add on?');") },null).ToString()).Encoded(false).Title("").Sortable(false).Width("3%"); }) .EnableCustomBinding(true) .DataBinding(databinding => databinding.Ajax().Select("_Index", "ProductGrid")) .Pageable(settings => settings.Total((int)ViewData["TotalPages"]) .PageSize(10)) .Sortable() .Render(); %> but I need to add a serial number column in telerik grid.How can i do this?

    Read the article

  • jqGrid Sort or Search does not work with columns having json dot notation

    - by rsmoorthy
    I have this jqGrid: $("#report").jqGrid( { url: '/py/db?coll=report', datatype: 'json', height: 250, colNames: ['ACN', 'Status', 'Amount'], colModel: [ {name:'acn', sortable:true}, {name:'meta.status', sortable:true}, {name:amount} ], caption: 'Show Report', rownumbers: true, gridview: true, rowNum: 10, rowList: [10,20,30], pager: '#report_pager', viewrecords: true, sortname: 'acn', sortorder: "desc", altRows: true, loadonce: true, mtype: "GET", rowTotal: 1000, jsonReader: { root: "rows", page: "page", total: "total", records: "records", repeatitems: false, id: "acn" } }); Notice that the column 'meta.status' is in JSON dot notation and accordingly the data sent from the server is like this: {"page": "1", "total": "1", "records": "5", "rows": [ {"acn":1,"meta": {"status":"Confirmed"}, "amount": 50}, {"acn":2,"meta": {"status":"Started"}, "amount": 51}, {"acn":3,"meta": {"status":"Stopped"}, "amount": 52}, {"acn":4,"meta": {"status":"Working"}, "amount": 53}, {"acn":5,"meta": {"status":"Started"}, "amount": 54} ] } The problems are of two fold: Sorting does not work on columns with dot notation, here "meta.status". It does not even show the sortable icons on the column header, and nothing happens even if the header is clicked. Sorting does not work, whether loadonce is true or false. If I try Searching (after setting loadonce to true) for the column meta.status (other columns without dot notation is okay), then it throws up a javascript error like this. Any help? Thanks Moorthy

    Read the article

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