Search Results

Search found 215 results on 9 pages for 'thead'.

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

  • Spring MVC Table selected row

    - by ich-bin-drin
    Hi, in a Spring MVC 2.5 application i'm using a spring <form:form> component and in this form a table with c:forEach is rendered. In each row a submit button is placed in. If i start a submit by clicking a button i would like to knwo, which button has processed the submit. <form:form commandName="formObject"> <table class="data-table" cellpadding="1" cellspacing="1" border="0"> <thead> <tr> </tr> </thead> <c:forEach items="${list}" var="document" varStatus="row"> <tr> <td> <input type="submit" value="${document.title}"/> <td> </tr> </c:forEach> </table> </form:form> THX.

    Read the article

  • HTML table manipulation using jQuery

    - by Daniel
    I'm building a site using CakePHP and am currently working on adding data to two separate tables at the same time.. not a problem. The problem I have is that I'm looking to dynamically alter the form that accepts the input values, allowing the click of a button/link to add an additional row of form fields. At the moment I have a table that looks something like this: <table> <thead> <tr> <th>Campus</th> <th>Code</th> </tr> </thead> <tbody> <tr> <td> <select id="FulltimeCourseCampusCode0CampusId" name="data[FulltimeCourseCampusCode][0][campus_id]"> <option value=""></option> <option value="1">Evesham</option> <option value="2">Malvern</option> </select> </td> <td> <input type="text" id="FulltimeCourseCampusCode0CourseCode" name="data[FulltimeCourseCampusCode][0][course_code]"> </td> </tr> </tbody> What I need is for the row within the tbody tag to be replicated, with the minor change of having all the zeros (i.e. such as here FulltimeCourseCampusCode0CampusId and here data[FulltimeCourseCampusCode][0][campus_id]) incremented. I'm very new to jQuery, having done a few minor bits, but nothing this advanced (mostly just copy/paste stuff). Can anyone help? Thank you.

    Read the article

  • remove row on click on specific td of that row by jquery

    - by I Like PHP
    i have an table <table class="oldService"> <thead> <th>name</th> <th>age</th> <th>action</th> </thead> <tbody> <?php foreach($array as $k=>$v){ ?> <tr> <td><?php echo $k[name] ?></td> <td><?php echo $k[age]?></td> <td id="<?php $k[id]" class="delme">X</td> </tr> <?php } ?> </tbody> <table> now i want to delete any row by clicking on X of each row except first and last row, and also need to confirm before deletion. i used below jquery <script type="text/javascript"> jQuery(document).ready(function(){ jQuery('table.oldService>tbody tr').not(':first').not(':last').click(function(){ if(confirm('want to delete!')){ jQuery(jQuery(this).addClass('del').fadeTo(400, 0, function() { jQuery(this).remove()})); jQuery.get('deleteService.php', {id:jQuery(this).attr('id')}); } else return false;}); }); </script> this is working perfect,but it execute by click on that row( means any td), i want that this event only occour when user click on X(third td) . please suggest me how to modify this jquery so that the event occur on click of X.

    Read the article

  • How to make header row of a table (with horizontal and vertical scrollers) fixed ?

    - by understack
    I've this sample table and I want to make header row of table visible all the time. Header row should scroll with horizontal scrollbar and shouldn't scroll with vertical scrollbar. table: <div style="width:800px; height:150px;overflow:scroll;margin:50px auto;"> <table style="width:1600px" border="1"> <thead style=""> <tr> <th style="width:800px">id_1</th> <th style="width:800px">id_2</th> </tr> </thead> <tbody style=""> <tr><td>1200</td><td>1200</td></tr> <tr><td>1200</td><td>1200</td></tr> <tr><td>1200</td><td>1200</td></tr> <tr><td>1200</td><td>1200</td></tr> <tr><td>1200</td><td>1200</td></tr> <tr><td>1200</td><td>1200</td></tr> <tr><td>1200</td><td>1200</td></tr> <tr><td>1200</td><td>1200</td></tr> </tbody> </table> </div> How can I do this with css only? Suggestions in this and this thread didn't seem to work, possibly due to presence of scrollbars.

    Read the article

  • How to remove the link if value is 0 using asp.net mvc

    - by kumar
    i have this code.. <table class="dashboard-table"> <thead> <tr> <th>&nbsp;</th> <th>Worked</th> </tr> </thead> <% foreach (var e in Model.ExceptionsByType) { %> <tr> <td> <%=Html.ActionLink(e.ExceptionTypeName, "VirtualScrollingDataRequested", Model.exceptionCategory.GetControllerName(), new { C_EXCPT_TYPE = e.ExceptionTypeID, GUI_SPEC_STAT_DSPL = 2, C_EXCPT_CATG = Model.exceptionCategory.Id, @ASSET_CLASS = string.Empty, @INST_MNEM = string.Empty, @_lock = "ALL" }, new { @title = e.BuildGridTitle(2, e.ExceptionTypeName) })%> </td> <td class="number"> <%=e.WorkedExceptions %> </td> </tr> <% } %> </table> e.WorkedExceptions is the count of exceptions.. I need to to the condition here if the e.workedexceptions == 0 I need to remove the link? please can any body hlep me out? thanks

    Read the article

  • ASP.NET Grid with CSS in Rows and Columns

    - by user1089173
    I have the following code List<Department> depts = new List<Department>(); Department.Add(new Department() { DNo = 1, DName = "Accounting", DFloor="6" }); Department.Add(new Department() { DNo = 2, DName = "FInance", DFloor="3" }); I want to bind this data to a GridView, so that it outputs the following. Observe the classes on each th and tr. How can I achieve this in ASP.NET? <thead> <tr> <th class="DNo">DNo</th> <th class="DName">DName</th> <th class= "DFloor">DFloor</th> </tr> </thead> <tr> <td class="DNo">1</td> <td class="DName">Accounting</td> <td class="DFloor">6</td> </tr> <tr> <td class="DNo">2</td> <td class="DName">FInance</td> <td class="DFloor">3</td> </tr>

    Read the article

  • Create modal form dialog in function

    - by Hainlp
    My app works with many modal form dialogs, i want to create modal form dialog by call a function, but i get error when i click OK button on dialog "i.apply is not a function". My code below html: <div id="dlg_srch_acnt"> <table cellpadding="0" cellspacing="0" border="0" class="display" id="dtl_acnt_srch" style=" padding-bottom:0px;"> <thead> <tr> <th>Id</th> <th>Account name</th> </tr> </thead> <tbody> </tbody> </table> </div> Script function init_dlg(id, autoOpen, height, width, modal, fn_button1) { id.dialog({ autoOpen:autoOpen, height:height, width:width, modal:modal, buttons:{ 'OK':fn_button1, }, close:fn_close }); } function fn_ok() { $('#parnt_acnt').val(acnt_name); $('#dlg_srch_acnt').('close'); } init_dlg($('#dlg_srch_acnt'), false, '440', '480', true, 'fn_ok()');

    Read the article

  • ul/li to table (with good styling)

    - by user584018
    I have ONLY one <UL> and under that we have group of <LI> <ul> <li>1<li> <li>2<li> <li>3</li> <li>4<li> </ul> now I wanted to show them as TABLE, please help me with CSS, how can we show as a TABLE for above UL/LI in below table format, 2 LI set in one TR (two TD) and so on.... <html> <table border="1"> <thead> <th>col1</th><th>col1</th> </thead> <tr><td>1</td><td>2</td></tr> <tr><td>3</td><td>4</td></tr> </table> </html>

    Read the article

  • Sorting a table based on which header cell was clicked

    - by cf_PhillipSenn
    If I have the following: <table> <thead> <tr> <th><a href="Index.cfm?Sort=0">First</a></th> <th><a href="Index.cfm?Sort=1">Second</a></th> <th><a href="Index.cfm?Sort=2">Third</a></th> </tr> </thead> <tbody> <tr> <td>A</td> <td class="num">123</td> <td>XYZ</td> </tr> </tbody> </table> Q: How do I sort the table body based upon which table header cell was clicked? <script> $('th a').click(function() { var $this = $(this).closest('th'); console.log($this.index()); return false; }); </script> (I made each of the table header cells hyperlinks so that if the user has JavaScript turned off, it will follow the link and be sorted on the server side).

    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

  • Windows 7 doesnt boot after installing Ubuntu 12.10 (Asus Zenbook Prime / UEFI problem)

    - by jpdus
    Today I installed Ubuntu and since then i cannot boot into Windows anymore. I used the "standard" option (didnt change any partitions manually, just entered the size) but used the UEFI-mode. At first the GRUB entries for Windows did not work at all, after reading this thead i was able to add a new Grub entry - now i can get into the "windows-loading" screen for a few seconds but then i always see some kind of bluescreen for a fraction of a second and the laptop reboots. I can get into the windows recovery partition but the only option there is to reset everything to factory settings (+erase all data). I have no idea how to get into the Windows 7 repair mode which was mentioned here (tried everything else in this thread too - no success). My boot info can be found here: http://paste.ubuntu.com/1411573/ I have no idea what went wrong (there is even an extra page for the Zenbook Prime where no installation problems are mentioned). I would appreciate any help/ideas, many thanks!

    Read the article

  • MVC - Ajax form - return partial view doesnt update in <div> target

    - by Jack
    I have an index view that I want to update automatically as the user types in a client id. I got something similiar to work (only it was updating just a label) - but this will not work. What happens is the partial is just rendered by itself (not in place of the UpdateTargetID). So the data is rendered on a new page. Here is my code: Controller: public ActionResult ClientList(string queryText) { var clients = CR.GetClientLike(queryText); return PartialView("ClientIndex", clients); } Partial View: <table> <thead> <tr> <td>Client ID</td> <td>Phone1</td> <td>Phone2</td> <td>Phone3</td> <td>Phone4</td> </tr> </thead> <tbody> <% if (Model != null) { foreach (Client c in Model) { %> <tr> <td><%= Html.Encode(c.ClientID)%></td> <td><%= Html.Encode(c.WorkPhone)%></td> <td><%= Html.Encode(c.WorkPhone1)%></td> <td><%= Html.Encode(c.WorkPhone2)%></td> <td><%= Html.Encode(c.WorkPhone3)%></td> </tr> <% } } %> </tbody> Main View: Insert code messed up, so this is just copy/pasted: $(function() { $("#queryText").keyup(function() { $('#sForm').submit(); }); }); <% using (Ajax.BeginForm("ClientList", /* new { queryText = Form.Controls[2] ?? }*/"", new AjaxOptions { UpdateTargetId = "status", InsertionMode = InsertionMode.Replace }, new { @id = "sForm" })) { % <% } % <div id="status" class="status" name="status"> <%--<% Html.RenderPartial("ClientIndex", ViewData["clients"]); %> Should this be here???? --%> </div>

    Read the article

  • updating/refereshing dojo datagrid with new store value on combobox value changes

    - by Raj
    hey all, I have a combo box and a datagrid in my page. when the user changes the combo box value i have to update the grid with children details of newly selected parent. How can I achieve this using Dojo combo box and datagrid. the following code snippet not working for me. when I use setStore method on the grid with new json data. <div dojoType="dojo.data.ItemFileReadStore" jsId="store" url="/child/index/"></div> // grid store <div dojoType="dojo.data.ItemFileReadStore" jsId="parentStore" url="/parent/index/"></div> // combo box store //combo box <input dojoType="dijit.form.ComboBox" value="Select" width="auto" store="parentStore" searchAttr="name" name="parent" id="parent" onchange="displayChildren()"> //MY GRID <table dojoType="dojox.grid.DataGrid" jsId="grid" store="store" id="display_grid" query="{ child_id: '*' }" rowsPerPage="2" clientSort="true" singleClickEdit="false" style="width: 90%; height: 400px;" rowSelector="20px" selectionMode="multiple"> <thead> <tr> <th field="child_id" name="ID" width="auto" editable="false" hidden="true">Text</th> <th field="parent_id" name="Parent" width="auto" editable="false" hidden="true">Text</th> <th field="child_name" name="child" width="300px" editable="false">Text</th> <th field="created" name="Created Date" width="200px" editable="false" cellType='dojox.grid.cells.DateTextBox' datePattern='dd-MMM-yyyy'></th> <th field="last_updated" name="Updated Date" width="200px" editable="false" cellType='dojox.grid.cells.DateTextBox' datePattern='dd-MMM-yyyy'></th> <th field="child_id" name="Edit/Update" formatter="fmtEdit"></th> </tr> </thead> </table> //onchange method of parent combo box in which i am trying to reload the grid with new data from the server. function displayChildren() { var selected = dijit.byId("parent").attr("value"); var grid = dojo.byId('display_grid'); var Url = "/childsku/index/parent/" + selected; grid.setStore(new dojo.data.ItemFileReadStore({ url: Url })); } But its not updating my grid with new contents. I don know how to refresh the grid every time users changes the combo box value. Could anyone help me to solve this issue... I would be glad if I get the solution for both ItemFileReadStore and ItemFileWrireStore. Thanks Raj..

    Read the article

  • spring-roo dojox.grid.DataGrid not rendered

    - by Steve Wall
    Hello, I'm using spring-roo trying to use dojox.grid.DataGrid. The page renders as a plain table. Why does it not use the DataGrid? Thanks! Steve <div xmlns:spring="http://www.springframework.org/tags" xmlns:c="http://java.sun.com/jsp/jstl/core" xmlns:jsp="http://java.sun.com/JSP/Page" version="2.0"><jsp:output omit-xml-declaration="yes" /> <script type="text/javascript"> dojo.require("dijit.TitlePane"); </script> <script type="text/javascript" src="&lt;c:url value=&quot;/resources/dojo/dojo.js&quot; /&gt;"> </script> <script type="text/javascript" src="&lt;c:url value=&quot;/resources/spring/Spring.js&quot; /&gt;"> </script> <script type="text/javascript" src="&lt;c:url value=&quot;/resources/spring/Spring-Dojo.js&quot; /&gt;"> </script> <script type="text/javascript"> dojo.require("dojox.grid.DataGrid"); dojo.require("dojox.data.CsvStore"); </script> <div id="_title"><spring:message var="app_name" code="application.name" /> <spring:message var="title" code="welcome.titlepane" arguments="${app_name}" /> <script type="text/javascript"> Spring.addDecoration(new Spring.ElementDecoration( { elementId : '_title', widgetType : 'dijit.TitlePane', widgetAttrs : { title : '${title}' } })); </script> <h4>Title</h4> <table dojoType="dojox.grid.DataGrid"> <thead> <tr> <th field="fieldName" width="200px">Column Name</th> <th field="fieldName" width="200px">Column Name</th> </tr> </thead> <tbody> <tr> <td>test1</td> <td>test2</td> </tr> <tr> <td>test3</td> <td>test4</td> </tr> </tbody> </table> </div> </div>

    Read the article

  • Zend Form, table decorators

    - by levacjeep
    Hello, I am having an incredibly difficult time to decorate a Zend form the way I need to. This is the HTML structure I am in need of: <table> <thead><tr><th>one</th><th>two</th><th>three</th><th>four</th></thead> <tbody> <tr> <td><input type='checkbox' id='something'/></td> <td><img src='src'/></td> <td><input type='text' id='something'/></td> <td><input type='radio' group='justonegroup'/></td> </tr> <tr> <td><input type='checkbox' id='something'/></td> <td><img src='src'/></td> <td><input type='text' id='something'/></td> <td><input type='radio' group='justonegroup'/></td> </tr> </tbody> </table> The number of rows in the body is determined by my looping structure inside my form class. All ids will be unique of course. All radio buttons in the form belongs to one group. My issue really is that I am unsure how to create and then style the object Zend_Form_Element_MultiCheckbox and Zend_Form_Element_Radio inside my table. Where/how would I apply the appropriate decoraters to the checkboxes and radio buttons to have a form structure like above? My Form class so far: class Form_ManageAlbums extends Zend_Form { public function __construct($album_id) { $photos = Model_DbTable_Photos::getAlbumPhotos($album_id); $selector = new Zend_Form_Element_MultiCheckbox('selector'); $radio = new Zend_Form_Element_Radio('group'); $options = array(); while($photo = $photos->fetchObject()) { $options[$photo->id] = ''; $image = new Zend_Form_Element_Image('image'.$photo->id); $image->setImageValue('/dog/upload/'.$photo->uid.'/photo/'.$photo->src); $caption = new Zend_Form_Element_Text('caption'.$photo->id); $caption->setValue($photo->caption); $this->addElements(array($image, $caption)); } $selector->addMultiOptions($options); $radio->addMultiOptions($options); $this->addElement($selector); $this->setDecorators(array( 'FormElements', array('HtmlTag', array('tag' => 'table')), 'Form' )); } } I have tried a few combination of decoraters for the td and tr, but no success to date. Thank you for any help, very appreciated. JP Levac

    Read the article

  • Get the string representation of a jquery DOM object's entire HTML

    - by Scozzard
    Hi, I have had a bit of a look around and am having some difficulty solving a wee issue I am having. I basically have a string of HTML, I convert that to a JQuery DOM object so that I can easily remove all elements that have a certain class using JQuery's .remove(). I.e., var radHtml = editor.get_html(); var jqDom = $(radHtml); $(".thickbox", jqDom).remove(); $(".thickboxcontent", jqDom).remove(); editor.set_html(this.innerHTML); NOTE: The HTML is derived from content in a RADEditor text editor so there are no parent HTML tags, so can look as follows: <p>This is a header</p> <p>this is some content followed by a table </p> <a href="#TB_inline?height=350&amp;width=400&amp;inlineId=myOnPageContent0" class="thickbox">Test Thickbox</a> <div id="myOnPageContent0" class="thickboxcontent"> <table class="modal"> <thead> </thead> <tbody> <tr> <td>item</td> <td>result</td> </tr> <tr> <td>item 1</td> <td>1</td> </tr> <tr> <td>item 2</td> <td>2</td> </tr> <tr> <td>item 3</td> <td>3</td> </tr> </tbody> </table> </div> Here is what the jqDom.html() returns from the HTML above: "This is a header" I was wondering if there was an easy way to do this - have some html and remove all elements (in this case divs) that have a certain class (but leaving their contents). JQuery doesnt have to used, but I would like to. Manipulating the DOM object is fine - it is getting the full DOM object in its entirety as a string that I am having the problem with. Any help would be much appreicated. Thanks.

    Read the article

  • printing multi dimentional array

    - by Honey
    i have this multi dimentional array that i want to print into a table having each record/item go into its own row but it goes column wise. this is the output that im getting: http://mypetshopping.com/product.php ps: the value of $product will by dynamic based on what product is being viewed. <?php session_start(); ?> <table> <thead> <tr> <th>Name</th> <th>Hash</th> <th>Quantity</th> <th>Size</th> <th>Color</th> </tr> </thead> <tbody> <?php function addCart($product, $quantity, $size,$color) { $hash = md5($product); $_SESSION['cart'][$product]['name'] = $product; $_SESSION['cart'][$product]['hash'] = $hash; $_SESSION['cart'][$product]['quantity'] = $quantity; $_SESSION['cart'][$product]['size'] = $size; $_SESSION['cart'][$product]['color'] = $color; } addCart('Red Dress',1,'XL','red'); addCart('Blue Dress',1,'XL','blue'); addCart('Slippers',1,'XL','orange'); addCart('Green Hat',1,'XXXL','green'); $cart = $_SESSION['cart']; foreach($cart as $product => $array) { foreach($array as $key => $value) { ?> <tr> <td><?=$value;?></td> <td><?=$value;?></td> <td><?=$value;?></td> <td><?=$value;?></td> <td><?=$value;?></td> </tr> <?php } } ?>

    Read the article

  • Best practices for developing simple ASP.NET sites (built in controls or JQuery + scripts)

    - by Nix
    I was recently reviewing some code written by two different contractors, both were basic ASP.NET management sites. The sites allowed the user to view and edit data. Pretty much simple CRUD gateways. One group did their best to use built in ASP + AJAX Toolkit controls and did their best to use as many built in controls as possible. I found the code much easier to read and maintain. The other used jQuery and the code is heavily marked up with script blocks which are then used to build pages from javascript files. Which one is more common? The one that basically leveraged embedded HTML markup in scripts controled by javascript files screams readability and maintenance issues? Is this just the way of doing asp dev with jQuery? Assuming the second example happens a lot, are there tools that help facilitate jQuery development with visual studio? Do you think they generated the html somewhere else and just copied it in? Example Script block: <script id="HRPanel" type="text/html"> <table cellpadding='0' cellspacing='0' class="atable"><thead class="mHeader"><tr><th>Name</th><th>Description</th><th>Other</th></thead><tbody> <# for(var i=0; i < hrRows.length; i++) { var r = HRRows[i]; #> <tr><td><#=r.Name#></td><td><#=r.Description#></td><td class="taRight"><#=r.Other#></td></tr> <#}#> </tbody><tfoot><th></th><th></th><th></th></tfoot></table> </script> Then in a separate location (js file) you would see something like this. $("#HRPanel").html($("#HRPanel").parseTemplate({ HRRows: response.something.bah.bah }));

    Read the article

  • How to make a table, which is wider than screen size, scrollable and keep header row fixed?

    - by understack
    I've a table with 2 columns and each column is 800px wide. I want to show this table in 800x50 window. So there should be horizontal and vertical scrollbar to view complete table. While I've found few related solutions (this and this) on SO, they only work if table width is smaller than screen size. In my case screen size is 1200px and total table width is 1600px. How could I do this? i want to achieve something like this. EDIT Oops, I forgot to add one more requirement. Sorry. I want the header of the table to remain fixed while user scrolls table. EDIT2 I've tried below mentioned solutions to wrap in a div, but in this case vertical scrollbar doesn't show up. Please see this table with wrapper div. It seems this problem only occurs if table width is bigger than screen size. I'm testing on FF3.6. EDIT3 current table code: <div style="overflow:scroll; width:800px;height:50px" > <table style="width:1600px" border="1"> <thead> <tr> <th style="width:800px">id_1</th> <th style="width:800px">id_1</th> </tr> </thead> <tbody style=""> <tr><td>1200</td><td>1200</td></tr> <tr><td>1200</td><td>1200</td></tr> <tr><td>1200</td><td>1200</td></tr> <tr><td>1200</td><td>1200</td></tr> <tr><td>1200</td><td>1200</td></tr> <tr><td>1200</td><td>1200</td></tr> </tbody> </table> </div>

    Read the article

  • jquery performing calculation on dynamically generated elements

    - by user306472
    I have a table made up of a row of 3 input elements: Price, Quanity, and Total. Under that, I have two links I can click to dynamically generate another row in the table. All that is working well, but actually calculating a value for the total element is giving me trouble. I know how to calculate the value of the first total element but I'm having trouble extending this functionality when I add a new row to the table. Here's the html: <table id="table" border="0"> <thead> <th>Price</th><th>Quantity</th><th>Total</th> </thead> <tbody> <tr> <td><input id ="price" type = "text"></input></td> <td><input id ="quantity" type = "text"></input></td> <td><input id ="total" type = "text"></input></td> </tr> </tbody> </table> <a href="#" id="add">Add New</a> <a href="#" id="remove">Remove</a> Here's the jquery I'm using: $(function(){ $('a#add').click(function(){ $('#table > tbody').append('<tr><td><input id ="price" type = "text"></input></td><td><input id ="quantity" type = "text"></input></td><td><input id ="total" type = "text"></input></td></tr>'); }); $('a#remove').click(function(){ $('#table > tbody > tr:last').remove(); }); }); $(function(){ $('a#calc').click(function(){ var q = $('input#quantity').val(); var p = $('input#price').val(); var tot = (q*p); $('input#total').val(tot); }); }); I'm new to jquery so there's probably a simple method I don't know about that selects the relevant fields I want to calculate. Any guidance would be greatly appreciated.

    Read the article

  • ASP.NET MVC: How to display strongly typed view model, containing list of items, which also contain

    - by Sam Delaney
    Hi, I'm building an app using ASP.NET MVC which I want to use a strongly type view model, which contains a List called items which contains an id int and itemName string. The view model also conatins a List called people, and the Person class contains a List. The way I want to display the information is as a table, with each row having a column of Person name, then n number of columns which contain checkboxes, one for each of the List, and checked based on whether the Person's List (called items) contains the id of the Item. I have the display working fine, but I'm struggling to understand how to name the items so that the posted method can read the data. This is what I have in the BeginForm: <table cellpadding="20"> <thead> <th>Person name</th> <!-- for each of the items, create a column with the item name --> <% foreach( var i in Model.items ) { %> <th><%= Html.Encode(i.itemName) %></th> <% } %> </thead> <% foreach( var p in Model.people ) { %> <tr> <td><%= Html.Encode(p.name) %></td> <!-- for each item, create a column with a checkbox --> <% foreach( var i in Model.items ) { %> <td> <% if( p.items.Contains(i.id) ) { %> <!-- vm is the name of the view model passed to the view --> <%= Html.CheckBox( "vm.people[" + p.id + "].items[" + i.id + "]", true ) %> <% } else { %> <%= Html.CheckBox( "vm.people[" + p.id + "].items[" + i.id + "]", false ) %> <% } %> </td> <% } %> </tr> <% } %> </table> And this code displays the information perfectly. When I click submit, however, I get an Object Reference Not Set.. error message. Can anyone help with this please?

    Read the article

  • MVC Rendered Partial, how to get partial/view model in main model post to controller

    - by user1475788
    I have a text file and when users upload the file, the controller action method parses that file using state machine and uses a generic list to store some values. I pass this back to the view in the form of an IEnumerable. Within my main view, based on this ienumerable list I render a partail view to iterate items and display labels and a textarea. Users could add their input in the text area. When the users hit the save button this ienumrable list from the partial view rendered is null. so please advice any solutions. here is my main view @model RunLog.Domain.Entities.RunLogEntry @{ ViewBag.Title = "Create"; Layout = "~/Views/Shared/_Layout.cshtml"; } @using (Html.BeginForm("Create", "RunLogEntry", FormMethod.Post, new { enctype = "multipart/form-data" })) { <div id="inputTestExceptions" style="display: none;"> <table class="grid" style="width: 450px; margin: 3px 3px 3px 3px;"> <thead> <tr> <th> Exception String </th> <th> Comment </th> </tr> </thead> <tbody> @if (Model.TestExceptions != null) { foreach (var p in Model.TestExceptions) { Html.RenderPartial("RunLogTestExceptionSummary", p); } } </tbody> </table> </div> } partial view as follows: @model RunLog.Domain.Entities.RunLogEntryTestExceptionDisplay <tr> <td> @Model.TestException@ </td> <td>@Html.TextAreaFor(Model.Comment, new { style = "width: 200px; height: 80px;" }) </td> </tr> Controller action [HttpPost] public ActionResult Create(RunLogEntry runLogEntry, String ServiceRequest, string Hour, string Minute, string AMPM, string submit, IEnumerable<HttpPostedFileBase> file, String AssayPerformanceIssues1, IEnumerable<RunLogEntryTestExceptionDisplay> models) { } The problem is test exceptions which contains exception string and comment is comming back null.

    Read the article

  • get values from table as key value pairs with jquery

    - by liz
    I have a table: <table class="datatable" id="hosprates"> <caption> hospitalization rates test</caption> <thead> <tr> <th scope="col">Funding Source</th> <th scope="col">Alameda County</th> <th scope="col">California</th> </tr> </thead> <tbody> <tr> <th scope="row">Medi-Cal</th> <td>34.3</td> <td>32.3</td> </tr> <tr> <th scope="row">Private</th> <td>32.2</td> <td>34.2</td> </tr> <tr> <th scope="row">Other</th> <td>22.7</td> <td>21.7</td> </tr> </tbody> </table> i want to retrieve column 1 and column 2 values per row as pairs that end up looking like this [funding,number],[funding,number] i did this so far, but when i alert it, it only shows [object, object]... var myfunding = $('#hosprates tbody tr').each(function(){ var funding = new Object(); funding.name = $('#hosprates tbody tr td:nth-child(1)').map(function() { return $(this).text().match(/\S+/)[0]; }).get(); funding.value= $('#hosprates tbody tr td:nth-child(2)').map(function() { return $(this).text().match(/\S+/)[0]; }).get(); }); alert (myfunding);

    Read the article

  • Help needed wit the XPath statement for Selenium test

    - by mgeorge
    I am testing a calendar component using selenium.In my test i want to click on the current date.Please help me with the XPath statement for doing that.I am adding the HTML for the calender component <input id="event_date" type="text" on="click then l:show.event.calendar" style="border: 1px solid rgb(187, 187, 187); width: 100px;" fieldset="new_event" decorator="redbox" validator="date"/> <img id="app_136" style="position: relative; top: 2px;" on="click then l:show.event.calendar" src="images/calendar.png"/> <div id="app_137" style="margin: 0pt; padding: 0pt;"> <div id="app_calendar_2" class="yui-calcontainer single withtitle" style="position: absolute; z-index: 1000;"> <div class="title">Select Event Date</div> <table id="app_calendar_2_cal" class="yui-calendar y2010" cellspacing="0"> <thead> <tr> </tr> <tr class="calweekdayrow"> <th class="calweekdaycell">Su</th> <th class="calweekdaycell">Mo</th> <th class="calweekdaycell">Tu</th> <th class="calweekdaycell">We</th> <th class="calweekdaycell">Th</th> <th class="calweekdaycell">Fr</th> <th class="calweekdaycell">Sa</th> </tr> </thead> <tbody class="m6 calbody"> <tr class="w22"> <td id="app_calendar_2_cal_cell0" class="calcell oom calcelltop calcellleft">30</td> <td id="app_calendar_2_cal_cell1" class="calcell oom calcelltop">31</td> <td id="app_calendar_2_cal_cell2" class="calcell wd2 d1 selectable calcelltop"> </td> <td id="app_calendar_2_cal_cell3" class="calcell wd3 d2 today selectable calcelltop selected"> <a class="selector" href="#">2</a> </td> I want to click the date component described in <td id="app_calendar_2_cal_cell3" class="calcell wd3 d2 today selectable calcelltop selected"> <a class="selector" href="#">2</a> </td> Thanks in advance mgeorge

    Read the article

  • jquery tablesorter problem in FF only - header row disappears after show-hide of rows

    - by dac
    When the page loads, all the records show. Sorting works great until show-hide is used to filter the rows so only some show. Then the header row--with the arrows for sorting--DISAPPEARS. The problem is only in Firefox. It works great in IE7 and IE8. I'm using jQuery 1.4.2 from google. Code for show-hide $(document).ready(function() { // show all the rows $("#org_status tr").show(); //find selected filter $("#filter_status a").click(function(evt) { evt.preventDefault(); $("#org_status tr").hide(); var id = $(this).attr('id'); $("." + id).show(); }); }); Here is the HTML: <!-- show-hide "buttons" --> <p id='filter_status'>Filter by status: <a href='#' id='All'>All</a> <a href='#' id='Active'>Active</a> <a href='#' id='Inactive'>Inactive</a> <a href='#' id='Pending'>Pending</a> </p> <!-- table to sort -> <table id='org_status' class='info_table tablesorter'> <thead> <tr> <th class='org-name-col'>Name</th> <th class='org-status-col'>Status</th> </tr> </thead> <tbody> <tr class='All Active'> <td><a href='admin/org_edit.php?org=29'>Foo Net</a></td> <td>Active</td>"; </tr> <tr class='All Inactive'> <td><a href='admin/org_edit.php?org=22'>Bar</a></td> <td>Active</td>"; </tr> <tr class='All Pending'> <td><a href='admin/org_edit.php?org=11'> Bar Foo Very Long Org Name Goes Here</a></td> <td>Active</td>"; </tr> </tbody> </table>

    Read the article

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