Search Results

Search found 61 results on 3 pages for 'paginator'.

Page 2/3 | < Previous Page | 1 2 3  | Next Page >

  • problem by displaying images stored in a MySQL database?

    - by user1400
    i have images in my blob field in database i use blow colde for displaying image but it does not show any pic , someone could tell me where is my wrong? this is my model: public function getListUser() { $select = $this->select() ->order('lastname DESC'); $adapter = new Zend_Paginator_Adapter_DbTableSelect ($select); return $adapter; } this my controller: $userModel = new Admin_Model_User(); $adapter = $userModel->getListUser(); $paginator = new Zend_Paginator ($adapter); $paginator->setItemCountPerPage(1); $page = $this->_request->getParam('page', 1); $paginator->setCurrentPageNumber($page); $this->view->paginator = $paginator; this my view code: <td style="width: 20%;"> <?php echo $this->lastname ?> </td> <td style="width: 20%;"><?php header("Content-type: image/gif"); print $this->image; ?></td>

    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

  • Foreign keys and pagination

    - by whitstone86
    This is my pagination script: <?php /*********************************** * PhpMyCoder Paginator * * Created By PhpMyCoder * * 2010 PhpMyCoder * * ------------------------------- * * You may use this code as long * * as this notice stays intact and * * the proper credit is given to * * the author. * ***********************************/ ?> <head> <title> Pagination Test - Created By PhpMyCoder</title> <style type="text/css"> #nav { font: normal 13px/14px Arial, Helvetica, sans-serif; margin: 2px 0; } #nav a { background: #EEE; border: 1px solid #DDD; color: #000080; padding: 1px 7px; text-decoration: none; } #nav strong { background: #000080; border: 1px solid #DDD; color: #FFF; font-weight: normal; padding: 1px 7px; } #nav span { background: #FFF; border: 1px solid #DDD; color: #999; padding: 1px 7px; } </style> </head> <?php //Require the file that contains the required classes include("pmcPagination.php"); //PhpMyCoder Paginator $paginator = new pmcPagination(20, "page"); //Connect to the database mysql_connect("localhost","root","PASSWORD"); //Select DB mysql_select_db("tvguide"); //Select only results for today and future $result = mysql_query("SELECT programme, channel, airdate, expiration, episode, setreminder FROM epdata1 where airdate >= now() order by expiration GROUP BY airdate"); //You can also add reuslts to paginate here mysql_data_seek($queryresult,0) ; while($row = mysql_fetch_array($result)) { $paginator->add(new paginationData($row['programme'], $row['channel'], $row['airdate'], $row['expiration'], $row['episode'], $row['setreminder'])); } ?> <?php //Show the paginated results $paginator->paginate (); ?><? include("pca-footer1.php"); ?> <?php //Show the navigation $paginator->navigation(); ?> However, I have two tables in this, and they are epdata1 (where the airtimes for my show House M.D. are) and housemdep plus the setreminder table. How can I use foreign keys in relation to this? I'm not sure if this will work for my script, but am willing to try. What I would like to do is to select certain episodes from the table housemdep (episodes of the show) and if any are selected it shows them as this: House M.D. showing on Channel 1 June 6th - 8:00pm "Wilson" Set Reminder House M.D. showing on Channel 1 June 7th - 1:30am "Wilson" Set Reminder House M.D. showing on Channel 1 June 7th - 12:55pm "House's Head" Set Reminder or like this, if I have not selected an episode from the row: House M.D. showing on Channel 1 June 7th - 8:00pm "House's Head" Set Reminder House M.D. showing on Channel 1 June 8th - 9:00pm Set Reminder House M.D. showing on Channel 1 June 9th - 2:30pm Set Reminder House M.D. showing on Channel 1 June 7th - 8:00pm "Que Sera Sera" Set Reminder Foreign keys and relationship of interlinked tables are new to me, if anyone could help I'd appreciate this. I've tried some of what Google suggested on foreign keys in another version of this script (this is a clone of the original on my localhost server running Apache and PHP 5.28/MySQL), but am not sure how to implement this. Thanks.

    Read the article

  • Matching blank entries in django queryset for optional field with corresponding ones in a required

    - by gramware
    I have a django queryset in my views whose values I pack before passing to my template. There is a problem when the queryset returns none since associated values are not unpacked. the quersyet is called comments. Here is my views.py def forums(request ): post_list = list(forum.objects.filter(child='0')&forum.objects.filter(deleted='0').order_by('postDate')) user = UserProfile.objects.get(pk=request.session['_auth_user_id']) newpostform = PostForm(request.POST) deletepostform = PostDeleteForm(request.POST) DelPostFormSet = modelformset_factory(forum, exclude=('child','postSubject','postBody','postPoster','postDate','childParentId')) readform = ReadForumForm(request.POST) comments =list( forum.objects.filter(deleted='0').filter(child='1').order_by('childParentId').values('childParentId').annotate(y=Count('childParentId'))) if request.user.is_staff== True : staff = 1 else: staff = 0 staffis = 1 if newpostform.is_valid(): topic = request.POST['postSubject'] poster = request.POST['postPoster'] newpostform.save() return HttpResponseRedirect('/forums') else: newpostform = PostForm(initial = {'postPoster':user.id}) if request.GET: form = SearchForm(request.GET) if form.is_valid(): query = form.cleaned_data['query'] post_list = list((forum.objects.filter(child='0')&forum.objects.filter(deleted='0')&forum.objects.filter(Q(postSubject__icontains=query)|Q(postBody__icontains=query)|Q(postDate__icontains=query)))or(forum.objects.filter(deleted='0')&forum.objects.filter(Q(postSubject__icontains=query)|Q(postBody__icontains=query)|Q(postDate__icontains=query)).values('childParentId'))) if request.method == 'POST': delpostformset = DelPostFormSet(request.POST) if delpostformset.is_valid(): delpostformset.save() return HttpResponseRedirect('/forums') else: delpostformset = DelPostFormSet(queryset=forum.objects.filter(child='0', deleted='0')) """if readform.is_valid(): user=get_object_or_404(UserProfile.objects.all()) readform.save() else: readform = ReadForumForm()""" post= zip( post_list,comments, delpostformset.forms) paginator = Paginator(post, 10) # Show 10 contacts per page # Make sure page request is an int. If not, deliver first page. try: page = int(request.GET.get('page', '1')) except ValueError: page = 1 # If page request (9999) is out of range, deliver last page of results. try: post = paginator.page(page) except (EmptyPage, InvalidPage): post = paginator.page(paginator.num_pages) return render_to_response('forum.html', {'post':post, 'newpostform': newpostform,'delpost':delpostformset, 'username':user.username, 'comments':comments, 'user':user, },context_instance = RequestContext( request )) I realised that the issue was with the comments queryset comments =list( forum.objects.filter(deleted='0').filter(child='1').order_by('childParentId').values('childParentId').annotate(y=Count('childParentId'))) which will only returns values for posts that have comments. so i now need a way to return 0 comments when a value in post-list post_list = list(forum.objects.filter(child='0')&forum.objects.filter(deleted='0').order_by('postDate')) does not have any comments (optional field). Here is my models.py class forum(models.Model): postID = models.AutoField(primary_key=True) postSubject = models.CharField(max_length=100) postBody = models.TextField() postPoster = models.ForeignKey(UserProfile) postDate = models.DateTimeField(auto_now_add=True) child = models.BooleanField() childParentId = models.ForeignKey('self',blank=True, null=True) deleted = models.BooleanField() def __unicode__(self): return u' %d' % ( self.postID)

    Read the article

  • django blog - post- reply system display replies

    - by dana
    I have a mini blog app, and a reply system. I want to list all mini blog entries, and their replies, if there are any. i have in views.py def profile_view(request, id): u = UserProfile.objects.get(pk=id) paginator = New.objects.filter(created_by = request.user) replies = Reply.objects.filter(reply_to = paginator) return render_to_response('profile/publicProfile.html', { 'object_list': u, 'list':paginator, 'replies':replies }, context_instance=RequestContext(request)) and in the template: <h3>Recent Entries:</h3> {% for object in list %} <li>{{ object.post }} <br /> {% for object in replies %} {{ object.reply }} <br /> {% endfor %} mention : reply_to is a ForeignKey to New, and New is the name of the 'mini blog' table But it only shows all the replies for each blog entry, not the reply for every entry, if there is one thanks

    Read the article

  • How to optimize indexing of large number of DB records using Zend_Lucene and Zend_Paginator

    - by jdichev
    So I have this cron script that is deployed and ran using Cron on a host and indexes all the records in a database table - the index is later used both for the front end of the site and the backed operations as well. After the operation, the index is about 3-4 MB. The problem is it takes a lot of resources (CPU: 30+ and a good chunk of memory) and slows the machine down. My question is about how to optimize the operation described below: First there is a select query built using the Zend Framework API, this query is then passed to a Paginator factory that returns a paginator which I am using to balance the current number of items being indexed and not iterate over too much items. The script is iterating over the current items in the paginator object using a foreach loop until reaching the end and then it starts from the beginning after getting items for the next page. I am suspecting this overhead is caused by the Zend_Lucene but no idea how this could be improved.

    Read the article

  • Django microblog showing a logged in user only his posts

    - by dana
    i have a miniblog application, with a class named New(refering to a new post), having a foreign key to an user(who has posted the entry). above i have a method that displays all the posts from all the users. I'd like to show to the logged in user, only his posts How can i do it? Thanks in advance! def paginate(request): paginator = New.objects.all() return render_to_response('news/newform.html', { 'object_list': paginator, }, context_instance=RequestContext(request))

    Read the article

  • Cakephp change model's title without rename model/dbtable

    - by Vincent
    I have a table that store all information about class, but because Class is reserved for class name I had to rename the table from classes to types. But in the view section I need it to be displayed as "Class", including the Paginator links. Anyway to achieve this by adding something in the Type model, without completely customize Paginator and and all view compoenents?

    Read the article

  • Django: A Result Specific Numeration for Pagination.

    - by TheLizardKing
    Simply put I want what http://www.reddit.com/ and http://news.ycombinator.com/ have to the left of every link. A numerated link starting with 1 and continuing to the next page by means of pagination. I really enjoy using generic views and their built-in pagination for Django and it seems to allow me access to these values if I was on page 3 with 2 items per page. {'MEDIA_URL': ''} {'LANGUAGES': '<<languages>>', 'LANGUAGE_BIDI': False, 'LANGUAGE_CODE': 'en-us'} {'debug': True, 'sql_queries': '<<sql_queries>>'} {'messages': [], 'perms': <django.core.context_processors.PermWrapper object at 0xadedeec>, 'user': <User: thelizardking>} {'first_on_page': 5, 'has_next': True, 'has_previous': True, 'hits': 7, 'is_paginated': True, 'last_on_page': 6, 'links_list': [<Link: Funky Town>, <Link: Apple Jax>], 'next': 4, 'page': 3, 'page_obj': <Page 3 of 4>, 'page_range': [1, 2, 3, 4], 'pages': 4, 'paginator': <django.core.paginator.Paginator object at 0xadf914c>, 'previous': 2, 'results_per_page': 2} I know there is an add filter for templates but that's as close as I think I can get and that really doesn't do what I want. Am I going to have to use a custom template filter here or is there something I am not seeing?

    Read the article

  • function php with parameter 0

    - by Arnaud Ncy
    I have a function like this public function get_page($position) { switch ($position) { case "current": echo "current"; return $this->current_page; break; case "first": echo "first"; return $this->current_page >= 3 ? 1 : false; break; case "last": echo "last"; return $this->current_page <= $this->total_pages() - 2 ? ceil($this->count / $this->nb_items_to_show) : false; break; case "previous": echo "previous"; return $this->current_page - 1 >= 1 ? $this->current_page - 1 : false; break; case "next": echo "next"; return $this->current_page + 1 <= $this->total_pages() ? $this->current_page + 1 : false; break; case is_int($position): echo "int"; if ($position >= 1 && $position <= $this->total_pages()) { return $position; } else { return false; } break; default: echo "default"; return false; break; } } When I call the function, it works for every parameters except 0 and goes in "current" case in the switch. $paginator->get_page(0); If I call the function with quotes "0", it works. But the function could be called like this $paginator->get_page($paginator->get_page("current") - 2); How can I call the function with parameter 0 ?

    Read the article

  • Grails YUI- Datatable complete refresh

    - by geeronimo
    Hi, I have inserted a paginator for my YUI-Datatable. Now I want to refresh my whole page, when the user has changed the view in my Datatable. YUI makes just a refresh (remoteCall) for itself, but I need a refresh for the whole page, because I want to update my Flashanimation too. For any sugest I would be very grateful, Geeron imo Here´s the code for my datatable: paginatorConfig="[ template:'{FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {CurrentPageReport}', pageReportTemplate : '{startRecord} - {endRecord} von {totalRecords}', containers:'dt-paginator', firstPageLinkLabel: '&lt;&lt;', lastPageLinkLabel: '&gt;&gt;', previousPageLinkLabel: '&lt;', nextPageLinkLabel: '&gt;' ]" />

    Read the article

  • Defining where on the page the flowdocument I am printing will 'start' and 'end'

    - by Sagi1981
    Dear community. I am almost done with implementing a printing functionality, but I am having trouble getting the last hurdle done with. My problem is, that I am printing some reports, consisting of a header (with information about the person the report is about), a footer (with a page number) and the content in the middle, which is a FlowDocument. Since the flowdocuments can be fairly long, It is very possible that they will span multiple pages. My approach is to make a custom FlowDocumentPaginator which derives from DocumentPaginator. In there i define my header and my footer. However, when I print my page, the flowdocument and my header and footer are on top of eachother. So my question is plain and simple - how do I define from where and to where the flowdocument part on the pages will be placed? here is the code from my custommade Paginator: public class HeaderedFlowDocumentPaginator : DocumentPaginator { private DocumentPaginator flowDocumentpaginator; public HeaderedFlowDocumentPaginator(FlowDocument document) { flowDocumentpaginator = ((IDocumentPaginatorSource) document).DocumentPaginator; } public override bool IsPageCountValid { get { return flowDocumentpaginator.IsPageCountValid; } } public override int PageCount { get { return flowDocumentpaginator.PageCount; } } public override Size PageSize { get { return flowDocumentpaginator.PageSize; } set { flowDocumentpaginator.PageSize = value; } } public override IDocumentPaginatorSource Source { get { return flowDocumentpaginator.Source; } } public override DocumentPage GetPage(int pageNumber) { DocumentPage page = flowDocumentpaginator.GetPage(pageNumber); ContainerVisual newVisual = new ContainerVisual(); newVisual.Children.Add(page.Visual); DrawingVisual header = new DrawingVisual(); using (DrawingContext dc = header.RenderOpen()) { //Header data } newVisual.Children.Add(header); DrawingVisual footer = new DrawingVisual(); using (DrawingContext dc = footer.RenderOpen()) { Typeface typeface = new Typeface("Trebuchet MS"); FormattedText text = new FormattedText("Page " + (pageNumber + 1).ToString(), CultureInfo.CurrentCulture, FlowDirection.LeftToRight, typeface, 14, Brushes.Black); dc.DrawText(text, new Point(page.Size.Width - 100, page.Size.Height-30)); } newVisual.Children.Add(footer); DocumentPage newPage = new DocumentPage(newVisual); return newPage; } } And here is the printdialogue call: private void btnPrint_Click(object sender, RoutedEventArgs e) { try { PrintDialog printDialog = new PrintDialog(); if (printDialog.ShowDialog() == true) { FlowDocument fd = new FlowDocument(); MemoryStream stream = new MemoryStream(ASCIIEncoding.Default.GetBytes(<My string of text - RTF formatted>)); TextRange tr = new TextRange(fd.ContentStart, fd.ContentEnd); tr.Load(stream, DataFormats.Rtf); stream.Close(); fd.ColumnWidth = printDialog.PrintableAreaWidth; HeaderedFlowDocumentPaginator paginator = new HeaderedFlowDocumentPaginator(fd); printDialog.PrintDocument(paginator, "myReport"); } } catch (Exception ex) { //Handle } }

    Read the article

  • jQuery.width() & DOM refresh

    - by o_O Tync
    My script dynamically creates a <ul> width left-floating <li>s inside: it's a paginator. Afterwards, the script measures width of all <li>s and summs them up. The problem is that after the nodes are injected into the document — the browser refreshed DOM and applies CSS styles which takes a while. It has a negative effect on my script: when these operations are not complete before I measure the width — my script gets a wrong value. If I perform the measure in a second — everything is ok. The thing I'm looking for is a way to detect the moment when the <ul> is fully drawn, styles applied and the width has stabilizes. Or at least a way to detect every dimensions changes. If there's a way to detect width stabilization — I would do the measuring right after it to get the correct values. P.S. Why I need this. My paginator's left-floating <li> items tend to move to the next line when the <ul> tries to become wider than the page itself. Even though most of <li>s are invisible because of parent <div>'s width restriction: div { width: 500px; overflow: hidden; } div ul { width: 100%; white-space: nowrap; } div ul li { display: block; float: left; } they still go down unless I specify the actual summed width of the <ul> with the script.

    Read the article

  • Extracting function declarations from a PHP file

    - by byronh
    I'm looking to create an on-site API reference for my framework and application. Basically, say I have a class file model.class.php: class Model extends Object { ... code here ... // Separates results into pages. // Returns Paginator object. final public function paginate($perpage = 10) { ... more code here ... } } and I want to be able to generate a reference that my developers can refer to quickly in order to know which functions are available to be called. They only need to see the comments directly above each function and the declaration line. Something like this (similar to a C++ header file): // Separates results into pages. // Returns Paginator object. final public function paginate($perpage = 10); I've done some research and this answer looked pretty good (using Reflection classes), however, I'm not sure how I can keep the comments in. Any ideas? EDIT: Sorry, but I want to keep the current comment formatting. Myself and the people who are working on the code hate the verbosity associated with PHPDocumentor. Not to mention a comment-rewrite of the entire project would take years, so I want to preserve just the // comments in plaintext.

    Read the article

  • Django: getting the list of related records for a list of objects

    - by Silver Light
    Hello! I have two models related one-to many: class Person(models.Model): name = models.CharField(max_length=255); surname = models.CharField(max_length=255); age = models.IntegerField(); class Dog(models.Model): name = models.CharField(max_length=255); owner = models.ForeignKey('Person'); I want to output a list of persons below each person a list of dogs he has. Here's how I can do it: in view: persons = Person.objects.all()[0:100]; in template: {% for p in persons %} {{ p.name }} has dogs:<br /> {% for d in persons.dog_set.all %} - {{ d.name }}<br /> {% endfor %} {% endfor %} But if I do it like that, Django will execute 101 SQL queries which is very inefficient. I tried to make a custom manager, which will get all the persons, then all the dogs and links them in python, but then I can't use paginator (my another question: http://stackoverflow.com/questions/2532475/django-paginator-raw-sql-query ) and it looks quite ugly. Is there a more graceful way doing this?

    Read the article

  • What are the benefits of archiving?

    - by HappyDeveloper
    I always see sites that only keeps fresh content on the home or subsections, and the rest of the content is kept in a separate section called 'archive'. Recently I have also heard that NoSQL DB's like MongoDB are good for archiving (which makes me think this is related to performance) So why do sites archive their content? What's the benefit over say, a simple paginator through which you could reach all the content? Is archiving done for performance? Or SEO? Or just user experience?

    Read the article

  • Measure width() with jQuery after DOM refresh

    - by o_O Tync
    My script dynamically creates a <ul> width left-floating <li>s inside: it's a paginator. Afterwards, the script measures width of all <li>s and summs them up. The problem is that after the nodes are injected into the document — the browser refreshed DOM and applies CSS styles which takes a while. It has a negative effect on my script: when these operations are not complete before I measure the width — my script gets a wrong value. If I perform the measure in a second — everything is ok. The thing I'm looking for is a way to detect the moment when the <ul> is fully drawn, styles applied and the width has stabilizes. Or at least a way to detect every dimensions changes. Of course I can use setTimeout(..., 100) but it's ugly and I guess — not a solution at all. If there's a way to detect width stabilization — I would do the measuring right after it to get the correct values. HTML code generated by the DOM <div> <ul> <li><a href="...">1</a></li> <li><a href="...">2</a></li> .... </ul> </div> P.S. Why I need this. My paginator's left-floating <li> items tend to move to the next line when the <ul> tries to become wider than the page itself. Even though most of <li>s are invisible because of parent <div>'s width restriction: div { width: 500px; overflow: hidden; } div ul { width: 100%; white-space: nowrap; } div ul li { display: block; float: left; } they still go down unless I specify the actual summed width of the <ul> with the script.

    Read the article

  • Zend_Paginator / Doctrine 2

    - by Kevin
    I'm using Doctrine 2 with my Zend Framework application and a typical query result could yield a million (or more) search results. I want to use Zend_Paginator in line with this result set. However, I don't want to return all the results as an array and use the Array adapter as this would be inefficient, instead I would like to supply the paginator the total amount of rows then and array of results based on limit/offset amounts. Is this doable using the Array adapter or would I need to create my own pagination adapter?

    Read the article

  • CodePlex Daily Summary for Saturday, August 23, 2014

    CodePlex Daily Summary for Saturday, August 23, 2014Popular ReleasesDIII Save Editor: ROS Alpha 1.2.14.100: initial Ros alpha release please report all bugsSEToolbox: SEToolbox 01.044.014 Release 2: Fixed Ship name not saving. Fixed broken cubes view Bug. Fixed cast VRage.MyFixedPoint error when opening games with Meteors. Added checkbox when Importing 3d model to Export ship, to fill it as solid.CS-Script Source: Release v3.8.5: Fixed problem with the warnings getting hidden in case of the successful compilation cs-script.7z - CS-Script Suite (binaries, documentation, samples) cs-script.ExtensionPack.7z - CS-Script Extension Pack (additional binaries and samples) cs-scriptDocs.7z - CS-Script DocumentationOutlook 2013 Backup Add-In: Outlook Backup Add-In 1.3: Changelog for new version: Added button in config-window to reset the last backup-time (this will trigger the backup after closing outlook) Minimum interval set to 0 (backup at each closing of outlook) Catch exception when data store entry is corrupt Added two parameters (prefix and suffix) to automatically rename the backup file Updated VSTO-Runtime to 10.0.50325 Upgraded project to Visual Studio 2013 Added optional command to run after backup (e.g. pack backup files, ...) Add...babelua: 1.6.7.0: V1.6.7.0 - 2014.8.21New feature: add a file search window ( ctrl+1 or ALT+L ), like The file search in VC Assistant; Stability improvement: performance improvement when BabeLua load/unload; performance improvement when debugger load lua files;Open NFe: RDI Open NFe 3.0 (alpha): Atualização para o layout 3.10 da NFe.MSSQL Deployment Tool: Microsoft SQL Deploy Tool v1.3.1: MicrosoftSqlDeployTool: v1.3.1.38348 What's changed? Update namespace and assembly name. Bug fixing.SharePoint 2013 Search Query Tool: SharePoint 2013 Search Query Tool v2.1: Layout improvements Bug fixes Stores auth method and user name Moved experimental settings to Advanced boxCtrlAltStudio Viewer: CtrlAltStudio Viewer 1.2.2.41183 Alpha: This alpha of the CtrlAltStudio Viewer provides some preliminary Oculus Rift DK2 support. For more details, see the release notes linked to below. Release notes: http://ctrlaltstudio.com/viewer/release-notes/1-2-2-41183-alpha Support info: http://ctrlaltstudio.com/viewer/support Privacy policy: http://ctrlaltstudio.com/viewer/privacy Disclaimer: This software is not provided or supported by Linden Lab, the makers of Second Life.HDD Guardian: HDD Guardian 0.6.1: New: package now include smartctl 6.3; Removed: standard notification e-mail. Now you have to set your mail server to send e-mail alerts; Bugfix: USB detection error; custom e-mail server settings issue; bottom panel displays a wrong ATA error count.VG-Ripper & PG-Ripper: VG-Ripper 2.9.62: changes NEW: Added Support for 'MadImage.org' links NEW: Added Support for 'ImgSpot.org' links NEW: Added Support for 'ImgClick.net' links NEW: Added Support for 'Imaaage.com' links NEW: Added Support for 'Image-Bugs.com' links NEW: Added Support for 'Pictomania.org' links NEW: Added Support for 'ImgDap.com' links NEW: Added Support for 'FileSpit.com' links FIXED: 'ImgSee.me' linksExchange Database Recovery With and Without Log Files is Possible: Exchange Recovery Application: This Exchange Recovery Software comes with free trial edition which helps users to inspect the working capability of the recovery process. Download free demo version and repair inaccessible mailboxes from EDB file without any obstructions.Linq 4 Javascript: Version 2.4: Minor Changes Made Added Count() and Count(with where clause) Distinct will now use a dictionary instead of a custom dictionary object Organize the unit tests. The variable names will actually make sense and won't be 2 letters. SelectMany will now use the queryable logic.Office / SharePoint 2013 Continuous Integration with TFS 2012: 1.1.0.1: Fixed the following issues in TfsDropDrownloader: Updated to make it work with VS 2013 (including VS 2013 updates) in addition to VS2012. Extend the timeout of downloading drops from 100 seconds to 1 hour. Added more trouble shooting information in the output.CRM Solution CommandLine Helper: CRM Solution Cmd Helper 1.0.0.4: Includes : - Bug fix = Export argument validation : check directory path existence (thanks mszlapa)Office To PDF: OfficeToPDF 1.4: Adds support for additional file types: * mpp (requires MS Project >= 2010) * vsdx, vsdm (requires MS Visio >= 2013) * csv * odt, odc, odp * pot, potm, potx Improves stability and clean removal of COM objects. Adds new flags: * /verbose - to be more verbose when running * /markup - to allow document markup in the PDF when converting Word documents * /excel_max_rows - adds a maximum limit on the number of rows a worksheet can contain when converting Excel documents * /pdfa - crea...MongoRepository: MongoRepository 1.6.6: Installing using NuGet (recommended)MongoRepository is now a NuGet package for your convenience. Step-by-step instructions can be found in Installing MongoRepository using NuGet Installing using BinariesYou can also choose to download the binaries instead of using NuGet. There are 2 downloads: mongorepository_full.x.x.x contains all binaries required (MongoRepository and the 10gen C# driver) mongorepository.x.x.x contains only the MongoRepository binary Make sure you reference MongoReposit...Cryptography Enumerations JavaScript Shell: Cryptography Enumerations JavaScript Shell 1.0.0: First ReleaseCMake Tools for Visual Studio: CMake Tools for Visual Studio 1.2: This release adds the following new features and bug fixes from CMake Tools for Visual Studio 1.1: Added support for CMake 3.0. Added support for word completion. Added IntelliSense support for the CMAKEHOSTSYSTEM_INFORMATION command. Fixed syntax highlighting for tokens beginning with escape sequences. Fixed issue uninstalling CMake Tools for Visual Studio after Visual Studio has been uninstalled.GW2 Personal Assistant Overlay: GW2 Personal Assistant Overlay 1.1: Overview1.1 is the second 'stable' release of the GW2 Personal Assistant Overlay. This version includes just a couple of very minor features and some minor bug fixes. For details regarding installation, setup, and general use, see Documentation. Note: If you were using a previous version, you will probably want to copy over the following user settings files: GW2PAO.DungeonSettings.xml GW2PAO.EventSettings.xml GW2PAO.WvWSettings.xml GW2PAO.ZoneCompletionSettings.xml New FeaturesAdded new "No...New Projects3D Projectile: A 3D Projectile program showing the motion of a ballASP.NET Web Application Starter Kit: This project template is an ASP.NET solution skeleton for a typical web application or single-page application (SPA).Behaving - Behaviour Tree for C#: Behaviour is a Behaviour Tree implementation in C#.Kinect Stream Saver Application _SDK 2: This application is developed based on a sample called "ColorBasics-D2D C++" developed by Microsoft corporation. (Compatible with SDK 2: K4W v2 Dev Preview)MVC Bootstrap Paginator: The MVC Bootstrap Paginator is lightweight and easy to use. It's works out of the box and requires minimal configuration.NuGet Reference Switcher: NuGet Reference Switcher is a Visual Studio extension which can be used to automatically switch NuGet DLL references to project references and vice-versa. QKit: A WP8.1 library that provides various controls and classes that will help developers quickly and easily augment their apps to behave more like native apps.SharePoint 2013 Document Icon Linker: Links the document icon in library views to the document.SharePoint Autocomplete People Search: SharePoint People SearchWADM: WADM

    Read the article

  • Django pagination | get current index of paginated item in page index, (not the page index range its

    - by cka
    I am trying to build a photo gallery with Django. It is set up by category. I have paginated the results of a category by n amount of images per page. I want to also use the paginator on the page that shows just the single image and have a prev/next button for the prev/next image in that category. My thought was to get the current index for the image itself and have that be the link to the /category/CUR_IMG_ID_PAGINATION_LIST/ as the result of paginating the entire set would yield the same index as the current image index in the paginated results. For instance if the image i want is image 45 out of 150 images total for a category, then when i paginate the 150 images the 45 will be the actual number of the page I want. If there's an easier way to do this, let me know. Django 1.1

    Read the article

  • icefaces datatable component

    - by chetan
    I have two datatable in two different jspx page but when I call one then i try to call other old one still display what is the problem there. from the old page only datatable is display no other component are displayed. This is one jspx page -- -- <div style="margin-bottom: 20px;"> <div> <div class="page-navi"> <ice:dataPaginator id="dataScroll_3" for="companyDataTable1" paginator="true"> <f:facet name="first"> <ice:graphicImage url="/xmlhttp/css/xp/css-images/arrow-first.gif" title="First Page" /> </f:facet> <f:facet name="last"> <ice:graphicImage url="/xmlhttp/css/xp/css-images/arrow-last.gif" title="Last Page" /> </f:facet> <f:facet name="previous"> <ice:graphicImage url="/xmlhttp/css/xp/css-images/arrow-previous.gif" title="Previous Page" /> </f:facet> <f:facet name="next"> <ice:graphicImage url="/xmlhttp/css/xp/css-images/arrow-next.gif" title="Next Page" /> </f:facet> </ice:dataPaginator> </div> <ice:panelGroup> <ice:dataTable id="companyDataTable1" rendered="#{createLeaveBean.empRender}" binding="#{createLeaveBean.empTable}" value="#{createLeaveBean.lstEmployeeeInfo}" var="currentRow" width="80%" cellpadding="0" cellspacing="0" headerClass="std-table-header" styleClass="std-table" rows="10"> <ice:column style="width: 1%"> <f:facet name="header"> <ice:selectBooleanCheckbox id="selectallemp" partialSubmit="true" value="#{createLeaveBean.selectAll}" valueChangeListener="#{createLeaveBean.toggleSelectedFields}" onkeydown="moveFocus(event,'selectoneemp')" tabindex="8"></ice:selectBooleanCheckbox> </f:facet> <ice:selectBooleanCheckbox id="selectoneemp" value="#{currentRow.notify}" tabindex="9" ></ice:selectBooleanCheckbox> </ice:column> <ice:column style="width: 5%;"> <f:facet name="header"><ice:outputText value="Employee Id" /></f:facet> <ice:outputText value="#{currentRow.employeeInfoId}" /> </ice:column> <ice:column style="width: 34%;"> <f:facet name="header"><ice:outputText value="Employee Name" /></f:facet> <ice:outputText value="#{currentRow.firstName}" /> </ice:column> </ice:dataTable> </ice:panelGroup> </div> <ice:commandButton id="createleave" tabindex="12" value="Create" action="#{createLeaveBean.createLeavePolicyEmp}" styleClass="std-btn" style="margin-right: 10px;margin-left: 50px;margin-top: 15px"></ice:commandButton> <ice:commandButton id="cancelleave" tabindex="13" value="Cancel" action="#{createLeaveBean.cancelLeavePolicyEmp}" rendered="true" styleClass="std-btn" style="margin-top: 15px"></ice:commandButton> </div> This is second jspx page <div class="page-navi"> <ice:dataPaginator id="dataScroll_4" for="companyDataTable2" paginator="true"> <f:facet name="first"> <ice:graphicImage url="/xmlhttp/css/xp/css-images/arrow-first.gif" title="First Page" /> </f:facet> <f:facet name="last"> <ice:graphicImage url="/xmlhttp/css/xp/css-images/arrow-last.gif" title="Last Page" /> </f:facet> <f:facet name="previous"> <ice:graphicImage url="/xmlhttp/css/xp/css-images/arrow-previous.gif" title="Previous Page" /> </f:facet> <f:facet name="next"> <ice:graphicImage url="/xmlhttp/css/xp/css-images/arrow-next.gif" title="Next Page" /> </f:facet> </ice:dataPaginator> </div> <ice:panelGroup> <ice:dataTable id="companyDataTable2" rendered="#{createLeaveBean.deptRender}" binding="#{createLeaveBean.empTable}" value="#{createLeaveBean.lstEmployeeeInfo}" var="currentRowww" width="96%" cellpadding="0" cellspacing="0" headerClass="std-table-header" styleClass="std-table" rows="10"> <ice:column style="width: 5%;"> <f:facet name="header"><ice:outputText value="Employee Id" /></f:facet> <ice:outputText value="#{currentRowww.employeeInfoId}" /> </ice:column> <ice:column style="width: 34%;"> <f:facet name="header"><ice:outputText value="Employee Name" /></f:facet> <ice:outputText value="#{currentRowww.firstName}" /> </ice:column> </ice:dataTable> </ice:panelGroup> <ice:commandButton id="createLeave" value="Create" action="#{createLeaveBean.createLeavePolicyDept}" styleClass="std-btn" tabindex="8" style="margin-right: 10px;margin-left: 40px;margin-top: 15px"></ice:commandButton> <ice:commandButton id="cancelLeave" value="Cancel" action="#{createLeaveBean.cancelLeavePolicyDept}" rendered="true" styleClass="std-btn" tabindex="9" style="margin-top: 15px"></ice:commandButton>

    Read the article

  • Liquid templates - accessing members by name

    - by egarcia
    I'm using Jekyll to create a new blog. It uses Liquid underneath. Jekyll defines certain "variables": site, content, page, post and paginator. These "variables" have several "members". For instance, post.date will return the date of a post, while post.url will return its url. My question is: can I access a variable's member using another variable as the member name? See the following example: {% if my_condition %} {% assign name = 'date' %} {% else %} {% assign name = 'url' %} {% endif %} I have a variable called name which is either 'date' or 'url'. How can I make the liquid equivalent of post[name] in ruby? The only way I've found is using a for loop to iterate over all the pairs (key-value) of post. Beware! It is quite horrible: {% for property in post %} {% if property[0] == name %} {{ property[1] }} {% endif %} {% endfor %} Argh! I hope there is a better way. Thanks.

    Read the article

  • What's the best way to paginate a dataset with Zend_Framework and Doctrine?

    - by joedevon
    Before I start to build this myself I thought I'd ask others to share their experience. What's the best / your favorite way to paginate a dataset with an application built upon Zend_Framework and Doctrine as your ORM? I'm new to Doctrine. I'm calling the model directly from a View Helper, bypassing the Controller, although I'm still interested if your solution uses controllers. I did see one article on this topic: http://ciaranmcnulty.com/blog/2009/06/Simplify-pagination-logic-using-a-custom-zend-paginator-adapter Devzone has an article using Doctrine, Zend Framework OR Pear, but none of those options mention a #ZF app that uses Doctrine.

    Read the article

  • Why did mislav-will_paginate start adding so much garbage to urls between rails 2.3.2 and 2.3.5?

    - by user30997
    I've used will_paginate in a number of projects now, but when I moved one of them to Rails 2.3.5, clicking on any of the pagination links (page number, next, prev, etc.,) went from getting nice URLs like this: http://foo.com/user/1/date/2005_01_31/phone/555-6161 to this: http://foo.com/?options[]=user&options[]=date&options[]=2005_01_31&options[]=phone&options[]=555-6161 I have a route that looks like this that is probably the source of the 'options' keyword: map.connect '/browse/*options', :controller=>'assets', :action=>'browse' It's enough of an annoyance that I'm willing to roll a paginator to get around this if there isn't a way to get back to where I was before. Is there a way to get will_paginate to turn array-style routes into sane urls again? Thanks.

    Read the article

< Previous Page | 1 2 3  | Next Page >