Search Results

Search found 7311 results on 293 pages for 'rows'.

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

  • performance problem looping through table rows

    - by Sridhar
    Hi, I am using jquery to loop through table rows and save the data. If the table has 200 rows it is performing slow. I am getting the javascript message "Stop Running this script" in IE when I call this method. Following is the code I am using to loop through table rows. Can you please let me know if there is a better way to do this. function SaveData() { var $table = $('#' + gridid); var rows = $table.find('tbody > tr').get(); var transactions = []; var $row, empno, newTransaction, $rowChildren; $.each(rows, function(index, row) { $row = $(row); $rowChildren = $row.children("td"); if ($rowChildren.find("input[id*=hRV]").val() === '1') { empno = $rowChildren.find("input[id*=tEmpno]").val(); newTransaction = new Array(); newTransaction[0] = company; newTransaction[1] = $rowChildren.find("input[id*=tEmpno]").val(); newTransaction[2] = $rowChildren.find("input[id*=tPC]").val(); newTransaction[3] = $rowChildren.find("input[id*=hQty]").val(); newTransaction[4] = $rowChildren.find("input[id*=hPR]").val(); newTransaction[5] = $rowChildren.find("input[id*=tJC]").val(); newTransaction[6] = $rowChildren.find("input[id*=tL1]").val(); newTransaction[7] = $rowChildren.find("input[id*=tL2]").val(); newTransaction[8] = $rowChildren.find("input[id*=tL3]").val(); newTransaction[9] = $rowChildren.find("input[id*=tL4]").val(); newTransaction[10] = $rowChildren.find("input[id*=tL5]").val(); newTransaction[11] = $rowChildren.find("input[id*=tL6]").val(); newTransaction[12] = $rowChildren.find("input[id*=tL7]").val(); newTransaction[13] = $rowChildren.find("input[id*=tL8]").val(); newTransaction[14] = $rowChildren.find("input[id*=tL9]").val(); newTransaction[15] = $rowChildren.find("input[id*=tL10]").val(); newTransaction[16] = $rowChildren.find("input[id*=tSF]").val(); newTransaction[17] = $rowChildren.find("input[id*=tCG]").val(); newTransaction[18] = $rowChildren.find("input[id*=tTF]").val(); newTransaction[19] = $rowChildren.find("input[id*=tWK]").val(); newTransaction[20] = $rowChildren.find("input[id*=tAI]").val(); newTransaction[21] = $rowChildren.find("input[id*=tWC]").val(); newTransaction[22] = $rowChildren.find("input[id*=tPI]").val(); newTransaction[23] = "E"; var record = newTransaction.join(';'); transactions.push(record); } }); if (transactions.length > 0) { var strTransactions = transactions.join('|'); //send data to server //here ajax function is called to save data. } }

    Read the article

  • XSLT: Display unique rows of filtered XML recordset

    - by Chris G.
    I've got a recordset that I'm filtering on a particular field (i.e. Manager ="Frannklin"). Now I'd like to group the results of that filtered recordset based on another field (Client). I can't seem to get Muenchian grouping to work right. Any thoughts? TIA! CG My filter looks like this: <xsl:key name="k1" match="Row" use="@Manager"/> <xsl:param name="dvt_filterval">Frannklin</xsl:param> <xsl:variable name="Rows" select="/dsQueryResponse/Rows/Row" /> <xsl:variable name="FilteredRowsAttr" select="$Rows[normalize-space(@*[name()=$FieldNameNoAtSign])=$dvt_filterval ]" /> Templates <xsl:apply-templates select="$FilteredRowsAttr[generate-id() = generate-id(key('k1',@Manager))]" mode="g1000a"> </xsl:apply-templates> <xsl:template match="Row" mode="g1000a"> Client: <xsl:value-of select="@Client"/> </xsl:template> Results I'm getting Client: Beta Client: Beta Client: Beta Client: Gamma Client: Delta Results I want Client: Beta Client: Gamma Client: Delta Sample recordset <dsQueryResponse> <Rows> <Row Manager="Smith" Client="Alpha " Project_x0020_Name="Annapolis" PM_x0023_="00123" /> <Row Manager="Ford" Client="Alpha " Project_x0020_Name="Brown" PM_x0023_="00124" /> <Row Manager="Cronkite" Client="Beta " Project_x0020_Name="Gannon" PM_x0023_="00129" /> <Row Manager="Clinton, Bill" Client="Beta " Project_x0020_Name="Harvard" PM_x0023_="00130" /> <Row Manager="Frannklin" Client="Beta " Project_x0020_Name="Irving" PM_x0023_="00131" /> <Row Manager="Frannklin" Client="Beta " Project_x0020_Name="Jakarta" PM_x0023_="00132" /> <Row Manager="Frannklin" Client="Beta " Project_x0020_Name="Vassar" PM_x0023_="00135" /> <Row Manager="Jefferson" Client="Gamma " Project_x0020_Name="Stamford" PM_x0023_="00141" /> <Row Manager="Cronkite" Client="Gamma " Project_x0020_Name="Tufts" PM_x0023_="00142" /> <Row Manager="Frannklin" Client="Gamma " Project_x0020_Name="UCLA" PM_x0023_="00143" /> <Row Manager="Jefferson" Client="Gamma " Project_x0020_Name="Villanova" PM_x0023_="00144" /> <Row Manager="Carter" Client="Delta " Project_x0020_Name="Drexel" PM_x0023_="00150" /> <Row Manager="Clinton" Client="Delta " Project_x0020_Name="Iona" PM_x0023_="00151" /> <Row Manager="Frannklin" Client="Delta " Project_x0020_Name="Temple" PM_x0023_="00152" /> <Row Manager="Ford" Client="Epsilon " Project_x0020_Name="UNC" PM_x0023_="00157" /> <Row Manager="Clinton" Client="Epsilon " Project_x0020_Name="Berkley" PM_x0023_="00158" /> </Rows> </dsQueryResponse>

    Read the article

  • Simplifying a four-dimensional rule table in Matlab: addressing rows and columns of each dimension

    - by Cate
    Hi all. I'm currently trying to automatically generate a set of fuzzy rules for a set of observations which contain four values for each observation, where each observation will correspond to a state (a good example is with Fisher's Iris Data). In Matlab I am creating a four dimensional rule table where a single cell (a,b,c,d) will contain the corresponding state. To reduce the table I am following the Hong and Lee method of row and column similarity checking but I am having difficulty understanding how to address the third and fourth dimensions' rows and columns. From the method it is my understanding that each dimension is addressed individually and if the rule is true, the table is simplified. The rules for merging are as follows: If all cells in adjacent columns or rows are the same. If two cells are the same or if either of them is empty in adjacent columns or rows and at least one cell in both is not empty. If all cells in a column or row are empty and if cells in its two adjacent columns or rows are the same, merge the three. If all cells in a column or row are empty and if cells in its two adjacent columns or rows are the same or either of them is empty, merge the three. If all cells in a column or row are empty and if all the non-empty cells in the column or row to its left have the same region, and all the non-empty cells in the column or row to its right have the same region, but one different from the previously mentioned region, merge these three columns into two parts. Now for the confusing bit. Simply checking if the entire row/column is the same as the adjacent (rule 1) seems simple enough: if (a,:,:,:) == (a+1,:,:,:) (:,b,:,:) == (:,b+1,:,:) (:,:,c,:) == (:,:,c+1,:) (:,:,:,d) == (:,:,:,d+1) is this correct? but to check if the elements in the row/column match, or either is zero (rules 2 and 4), I am a bit lost. Would it be something along these lines: for a = 1:20 for i = 1:length(b) if (a+1,i,:,:) == (a,i,:,:) ... else if (a+1,i,:,:) == 0 ... else if (a,i,:,:) == 0 etc. and for the third and fourth dimensions: for c = 1:20 for i = 1:length(a) if (i,:,c,:) == (i,:,c+1,:) ... else if (i,:,c+1,:) == 0 ... else if (i,:,c,:) == 0 etc. for d = 1:20 for i = 1:length(a) if (i,:,:,d) == (i,:,:,d+1) ... else if (i,:,:,d+1) == 0 ... else if (i,:,:,d) == 0 etc. even any help with four dimensional arrays would be useful as I'm so confused by the thought of more than three! I would advise you look at the paper to understand my meaning - they themselves have used the Iris data but only given an example with a 2D table. Thanks in advance, hopefully!

    Read the article

  • WPF DataGrid Get All SelectedRows

    - by anvarbek raupov
    Have to use free WPF DataGrid (I thought Infragistics libraries are bad, I take it back after this) for this project of mine. Looks like DataGrid doesnt have clean MVVM Friendly way of getting the list of selectedRows ? I can data bind to SelectedItem="{Binding SelectedSourceFile}" but this only shows the 1st selected row. Need to be able to get all selected rows. Any hints to do it cleanly via MVVM ?

    Read the article

  • SQL - Add up all row-values of one column in a singletable

    - by ThE_-_BliZZarD
    Hello Everybody, I've got a question regarding a SQL-select-query: The table contains several columns, one of which is an Integer-column called "size" - the task I'm trying to perform is query the table for the sum of all rows (their values), or to be more exact get a artifical column in my ResultSet called "overallSize" which contains the sum of all "size"-values in the table. Preferable it would be possible to use a WHERE-clause to add only certain values ("WHERE bla = 5" or something similar). The DB-engine is HSQLDB (HyperSQL), which is compliant to SQL2008. Thank you in advance :)

    Read the article

  • Excel 2007 transpose/combine multiple rows into one.

    - by jzd
    I have data like so: 1001NCCN 3618127 1001NCCN 208478 1001NCCN 207316 1001TEMN 409889 1001TEMN 801651 1001TEMN 273134 1001TEMN 208478 1001TEMN 207316 I need to transpose/combine the rows that have matching values in the first column with a final result like so: 1001NCCN 3618127 208478 207316 1001TEMN 409889 801651 273134 208478 207316 I looked at Pivot Tables, and filtering but neither seemed like they can give me what I need. Is there a way to do this within Excel?

    Read the article

  • Copy entire rows from DataGrid

    - by fooLeDoo
    I'm using a software that outputs its results in a typical windows forms DataGrid. So you have you typical columns and rows. I would like to copy this data row by row or the entire table. Surely there must be a application for this that I haven´t discovered? THANKS GUYS.

    Read the article

  • Sql Server huge tables with no rows

    - by Mike Gates
    I have a Sql Server database that has a few tables with zero row count but take up a combined 10 GB of space. I can see this by doing right-click/properties on the tables in question (data space is huge, between 1 and 6 GB, and row count is zero on these tables). I have no clue what could be causing this as I would assume zero rows would mean nearly zero space taken. Any ideas?

    Read the article

  • SQL Statement Help... Ignore already existing rows

    - by Funchy
    I have a table with a foreign key constraint and the command below gives me an error because it's trying to set a value that already in the provider table. How do I update this command to ignore those rows that already exist in the provider table? UPDATE b SET b.iProvider_PVN = a.POIN FROM dbo.ASPVNTOPOIN_stg a INNER JOIN dbo.Provider b ON a.ASPVN = b.iProvider_PVN AND b.vcProv_Type = 'IPA' LEFT JOIN dbo.Provider c ON a.POIN = c.iProvider_PVN WHERE c.iProvider_PVN IS NULL

    Read the article

  • ICollectionView.SortDescriptions sort does not work if underlying DataTable has zero rows

    - by BigBlondeViking
    We have a WPF app that has a DataGrid inside a ListView. private DataTable table_; We do a bunch or dynamic column generation ( depending on the report we are showing ) We then do the a query and fill the DataTable row by row, this query may or may not have data.( not the problem, an empty grid is expected ) We set the ListView's ItemsSource to the DefaultView of the DataTable. lv.ItemsSource = table_.DefaultView; We then (looking at the user's pass usage of the app, set the sort on the column) Sort Method below: private void Sort(string sortBy, ListSortDirection direction) { ICollectionView dataView = CollectionViewSource.GetDefaultView(lv.ItemsSource); dataView.SortDescriptions.Clear(); var sd = new SortDescription(sortBy, direction); dataView.SortDescriptions.Add(sd); dataView.Refresh(); } In the Zero DataTable rows scenario, the sort does not "hold"? and if we dynamically add rows they will not be in sorted order. If the DataTable has at-least 1 row when the sort is applied, and we dynamically add rows to the DataTable, the rows com in sorted correctly. I have built a standalone app that replicate this... It is an annoyance and I can add a check to see if the DataTable was empty, and re-apply the sort... Anyone know whats going on here, and am I doing something wrong? FYI: What we based this off if comes from the MSDN as well: http://msdn.microsoft.com/en-us/library/ms745786.aspx

    Read the article

  • showing null rows using join

    - by Pradyut Bhattacharya
    Hi, In mysql i m selecting from a table shouts having a foreign key to another table named "roleuser" with the matching column as user_id Now the user_id column in the shouts table for some rows is null (not actually null but with no inserts in mysql) How to show all the rows of the shouts table either with user_id null or not I m executing the sql statement SELECT s.*, r.firstname, r.lastname FROM shouts s left join roleuser r where r.user_id = s.user_id limit 50; which does not executes and shows You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'where r.user_id = s.user_id limit 50' at line 2 but using inner join the sql executes which shows rows which only have user_id values in the shouts table. the nulls are not shown. SELECT s.*, r.firstname, r.lastname FROM shouts s inner join roleuser r where r.user_id = s.user_id limit 50; How can i show all the rows from the shouts table and null values in the firstname and lastname columns where the user_id is null in the shouts table. If not at all possible with sql may be using stored procedures... Thanks Pradyut

    Read the article

  • Sort on DataView does not work if DataTable has zero rows

    - by BigBlondeViking
    We have a WPF app that has a DataGrid insode a ListView. private DataTable table_; We do a bunch or dynamic column generation ( depending on the report we are showing ) We then do the a query and fill the DataTable row by row, this query may or may not have data.( not the problem, an empty grid is expected ) We set the ListView's ItemsSource to the DefaultView of the DataTable. lv.ItemsSource = table_.DefaultView; We then (looking at the user's pass usage of the app, set the sort on the column) Sort Method below: private void Sort(string sortBy, ListSortDirection direction) { var dataView = CollectionViewSource.GetDefaultView(lv.ItemsSource); dataView.SortDescriptions.Clear(); var sd = new SortDescription(sortBy, direction); dataView.SortDescriptions.Add(sd); dataView.Refresh(); } In the Zero DataTable rows scenario, the sort does not "hold"? and if we dynamically add rows they will not be in sorted order. If the DataTable has at-least 1 row when the sort is applied, and we dynamically add rows to the DataTable, the rows com in sorted correctly. I have built a standalone app that replicate this... It is an annoyance and I can add a check to see if the DataTable was empty, and re-sort... Anyone know whats going on here, and am I doing something wrong? FYI: What we based this off if comes from the MSDN as well: http://msdn.microsoft.com/en-us/library/ms745786.aspx

    Read the article

  • Horizontally align rows in multiple tables using web user control

    - by goku_da_master
    I need to align rows in different tables that are layed out horizontally. I'd prefer to put the html code in a single web user control so I can create as many instances of that control as I want and lay them out horizontally. The problem is, the text in the rows needs to wrap. So some rows may expand vertically and some may not (see the example below). When that happens, the rows in the other tables aren't aligned horizontally. I know I can accomplish all this by using a single table, but that would mean I'd have to duplicate the name, address and phone html code instead of dynamically creating new instances of my user control (in reality there are many more fields than this, but I'm keeping it simple). Is there any way to do this whether with div's, tables or something else? Here's the problem: Mary Jane's address field expands 2 lines, causing her phone field to not align properly with John's and Bob's. Name: John Doe Name: Mary Jane Name: Bob Smith Address: 123 broadway Address: Some really long address Address: Short address Phone: 123-456 that takes up multiple lines Phone: 111-2222 Phone: 456-789 I'm not restricted in any way how to do this (other than using asp.net), but I'd prefer to use a single web control that I instantiate X times at design time (in this example, it's 3 times). I'm using VS2008, and .Net 3.5

    Read the article

  • Select Table Rows by Grouping them Adjacent to each Other using XPath

    - by Adnan Yaseen
    I am not clear how to express my problem correctly in the question so forgive me if I am not able to properly convey my problem. I have following data. <tr class="header">Random Value 1</tr> <tr class="item">1</tr> <tr class="item">2</tr> <tr class="item">3</tr> <tr class="header">Random Value 2</tr> <tr class="item">4</tr> <tr class="item">5</tr> <tr class="item">6</tr> <tr class="header">Random Value 3</tr> <tr class="item">7</tr> <tr class="item">8</tr> <tr class="item">9</tr> What I want to acheive is that I want to select the with class header. I have achieved this by using the following line of code, HtmlNodeCollection headerNodes = doc.DocumentNode.SelectNodes("//tr[@class='header']"); Now I have all the header rows in the collection. Now I loop through all the header nodes and I want to get the table rows which are adjacent to the respective header rows. foreach (HtmlNode node in headerNodes) { HtmlNodeCollection itemNodes = ??? } My question is that what I should write here so that for header row with text "Random Value 1" I get the item rows 1,2 and 3. Similarly for header row with text "Random Value 2" I get the item row 4,5 and 6 and so on.

    Read the article

  • SQL string manipulation to return multiple rows

    - by Andy Jacobs
    I'm an experienced programmer, but relatively new to SQL. We're using Oracle 10 and 11. I have a system in place using SQL that combines actual rows with virtual rows (e.g. "SELECT 1 from DUAL") doing unions and intersects as needed, which all seems to work. My problem is that I need to combine this system which is expecting rows of data, with new data that will have the data in (let's say for simplification) comma delimited strings. So I think what I need is a way to convert a string like: "5,6,7,8" into 4 rows with one column each, with "5" in the first row, "6" in the second, etc. In other languages, I'd do a "Split" with comma as the delimiter. Of course, the data won't always have 4 entries. There's a second question, but I'll ask it separately. But I suspect it will simplify things, if possible, if the solution to the above could be used as a table in another SQL statement (i.e., to work with my existing system). Thanks for any help.

    Read the article

  • added row to a table with jquery but added rows disappear with browser refresh

    - by user840930
    I added rows to a html table with jquery, but when I refresh the browser, the rows disappear. How can I get the rows to stay? <TABLE id="dataTable" width="100%" align="center"> <TR align="center" border="1"> <TH></TH> <TH>ID </TH> <TH>Name</TH> <TH>Status</TH> </TR> <TR align="center"> <TD><INPUT type="checkbox" name="chk"/></TD> <TD> 1 </TD> <TD> <INPUT type="text" value="Submission 1" /> </TD> <TD>Working version</TD> </TR> </TABLE> <script type="text/javascript"> $(document).ready(function(){ $('#createNew').click(function() { var table = document.getElementById('dataTable'); var rowCount = table.rows.length; $('#dataTable tr:last').after('<TR align="center"><TD><INPUT type="checkbox" name="chk"/></TD><TD>'+ rowCount + '</TD><TD> <INPUT type="text" value="Submission 1" /> </TD><TD>Working version</TD></TR>');

    Read the article

  • Javascript tr click event with newly created rows

    - by yalechen
    I am very new to web development. I am currently using tablesorter jquery plugin to create a dynamic table, where the user can add and delete rows. I am having trouble with changing the background color of newly created rows upon clicking. It works fine with rows that are hard coded in html. Here is the relevant code: $(document).ready( function() { $('table.tablesorter td').click( function (event) { $(this).parent('tr').toggleClass('rowclick'); $(this).parent('tr').siblings().removeClass('rowclick'); }); } ) rowclick is a css class here: table.tablesorter tbody tr.rowclick td { background-color: #8dbdd8; } I have tried adding the following to my javascript function that adds a new row: var createClickHandler = function(newrow) { return function(event) { //alert(newrow.cells[0].childNodes[0].data); newrow.toggleClass('rowclick'); newrow.siblings().removeClass('rowclick'); }; } row.onclick = createClickHandler(row); The alert correctly displays the text in the first column of the row when I click the new row. However, my new rows do not respond to the css class. Anyone have any ideas? Thanks in advance.

    Read the article

  • Rows added to table are not showing up

    - by Lars
    This has been asked before, but I have found no solution that worked for me yet: When adding rows to a table from code, the rows are not showing up in the application. There is one row I specified in XML, that one is showing up, but nothing below it. This is the code: public void addRow(LocationMessage locationMsg){ View messageView = theInflater.inflate(R.layout.homepage, null); TableLayout table = (TableLayout)messageView.findViewById(R.id.distanceTable); TextView senderNameTextView = new TextView(thisContext); senderNameTextView.setText(locationMsg.getSenderName()); TableRow tr = new TableRow(thisContext); tr.addView(distanceTextView); table.addView(tr); rows.addFirst(messageView); } homepage.xml contains this, I removed some elements and parameters: <?xml version="1.0" encoding="utf-8"?> <LinearLayout> <TabHost> <TabWidget /> <FrameLayout> [..] <LinearLayout> [..] <TableLayout android:id="@+id/distanceTable" android:layout_height="wrap_content" android:layout_width="wrap_content" android:layout_gravity="center" android:background="#DDDDDD" android:stretchColumns="1" > <TableRow> <TextView android:textColor="#000000" android:text="@string/label_device" android:layout_gravity="center" android:padding="3dip" android:textSize="18sp" /> <TextView android:textColor="#000000" android:text="@string/label_distance" android:layout_gravity="center" android:padding="3dip" android:textSize="18sp" /> <TextView android:textColor="#000000" android:text="@string/label_time" android:layout_gravity="center" android:padding="3dip" android:textSize="18sp" /> </TableRow> </TableLayout> </LinearLayout> </FrameLayout> </TabHost> </LinearLayout> Unfortunately hierarchyviewer.bat doesn't work for me in order to check if the rows are there but just not visible. In the debugger it looks fine to me.

    Read the article

  • How to exclude rows where matching join is in an SQL tree

    - by Greg K
    Sorry for the poor title, I couldn't think how to concisely describe this problem. I have a set of items that should have a 1-to-1 relationship with an attribute. I have a query to return those rows where the data is wrong and this relationship has been broken (1-to-many). I'm gathering these rows to fix them and restore this 1-to-1 relationship. This is a theoretical simplification of my actual problem but I'll post example table schema here as it was requested. item table: +------------+------------+-----------+ | item_id | name | attr_id | +------------+------------+-----------+ | 1 | BMW 320d | 20 | | 1 | BMW 320d | 21 | | 2 | BMW 335i | 23 | | 2 | BMW 335i | 34 | +------------+------------+-----------+ attribute table: +---------+-----------------+------------+ | attr_id | value | parent_id | +---------+-----------------+------------+ | 20 | SE | 21 | | 21 | M Sport | 0 | | 23 | AC | 24 | | 24 | Climate control | 0 | .... | 34 | Leather seats | 0 | +---------+-----------------+------------+ A simple query to return items with more than one attribute. SELECT item_id, COUNT(DISTINCT(attr_id)) AS attributes FROM item GROUP BY item_id HAVING attributes > 1 This gets me a result set like so: +-----------+------------+ | item_id | attributes | +-----------+------------+ | 1 | 2 | | 2 | 2 | | 3 | 2 | -- etc. -- However, there's an exception. The attribute table can hold a tree structure, via parent links in the table. For certain rows, parent_id can hold the ID of another attribute. There's only one level to this tree. Example: +---------+-----------------+------------+ | attr_id | value | parent_id | +---------+-----------------+------------+ | 20 | SE | 21 | | 21 | M Sport | 0 | .... I do not want to retrieve items in my original query where, for a pair of associated attributes, they related like attributes 20 & 21. I do want to retrieve items where: the attributes have no parent for two or more attributes they are not related (e.g. attributes 23 & 34) Example result desired, just the item ID: +------------+ | item_id | +------------+ | 2 | +------------+ How can I join against attributes from items and exclude these rows? Do I use a temporary table or can I achieve this from a single query? Thanks.

    Read the article

  • Error : Number of Rows In Section in UITableView in iPhone SDK

    - by Meghan
    I am getting this error while I am trying to load the data into my table view. Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Invalid update: invalid number of rows in section 0. The number of rows contained in an existing section after the update (73) must be equal to the number of rows contained in that section before the update (71), plus or minus the number of rows inserted or deleted from that section (3 inserted, 0 deleted). What could be wrong? Thanks EDIT : I am initializing the array on ViewWillAppear and adding new objects to the same array on Tableview's didSelectRowAtIndexPath method Here is the code On viewWillAppear : cellTextArray = [[NSMutableArray alloc] init]; [cellTextArray addObjectsFromArray:newPosts]; Here is the code which modifies the array on didSelectRowAtIndexPath : [cellTextArray addObjectsFromArray:newPosts]; NSMutableArray *insertIndexPaths = [NSMutableArray array]; for (NSUInteger item = count; item < count + newCount; item++) { [insertIndexPaths addObject:[NSIndexPath indexPathForRow:item inSection:0]]; } [self.table beginUpdates]; [self.table insertRowsAtIndexPaths:insertIndexPaths withRowAnimation:UITableViewRowAnimationFade]; [self.table endUpdates]; [self.table scrollToRowAtIndexPath:indexPath atScrollPosition:UITableViewScrollPositionNone animated:YES]; NSIndexPath *selected = [self.table indexPathForSelectedRow]; if (selected) { [self.table deselectRowAtIndexPath:selected animated:YES]; } Here newPosts is an array which has the values that are added to cellTextArray on didSelectRowAtIndexPath method and viewWillAppear method.

    Read the article

  • How do I obtain selected rows in a DataGridView from different pages

    - by cmrhema
    Hi, I have a windows forms DataGridView, where I have data and a checkbox for each row. I will select check box for a particular row and all the selected rows will be populated in another page. if (grdEmp.Rows.Count > 0) { var selectedEmpIDs= from DataGridViewRow coll in grdEmp.Rows where Convert.ToBoolean(coll.Cells["Select"].Value) == true select coll; if (selectedEmpIDs.Count() > 0) { foreach (DataGridViewRow row in selectedEmpIDs) { selectedEmp+= row.Cells["EmpId"].Value + ","; } } } This works good only for one page. When I navigate to another page, and click the selected rows, the previous one goes off. How do I resolve it. Thanks cmrhema Note :Sorry for the confusion, When I meant it works good for a page, I meant paging. I think I need to add more inputs, There are 10 pages in the gridview. I select the first record from each page of the gridview, one after another by clicking next page( Page next button). But only the record that was selected the last is getting displayed and others and ignored off. What could be the prblm

    Read the article

  • JQuery 1.3.1 doesn't find dynamically generated rows

    - by Bamelis Steve
    I have just installed in the ASP.NET MVC RC2 and with that also using the JQuery 1.3.1 library. Before I was using the 1.2.6 library. Our application works fine under that library. But now I have strange problem. We have a grid view that we build up with the result of an AJAX call. With the result returned we add new rows to a table through cloning a hidden row. The generated HTML from the JQuery is placing extra parameters to the tags. These are in the form of JQuery12345678="null". They all have the same name. In the head of the table there is a checkbox that selects/unselects all the rows of the table. This by iterating through the rows of the table. $("#selectAllCheckbox").click(function() { var checked = this.checked; $("#dgNewTasks tbody tr").find(':input[type="checkbox"]').each(function() { this.checked = checked; }); }); Now by using the new library the check box are no longer set. I have used IE Developer Tools to check the HTML. If I remove the JQuery12345678="null" parameter from my rows. It works fine. Could someone tell me what I have to do?

    Read the article

  • SQL SERVER – OVER clause with FIRST _VALUE and LAST_VALUE – Analytic Functions Introduced in SQL Server 2012 – ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING

    - by pinaldave
    Yesterday I had discussed two analytical functions FIRST_VALUE and LAST_VALUE. After reading the blog post I received very interesting question. “Don’t you think there is bug in your first example where FIRST_VALUE is remain same but the LAST_VALUE is changing every line. I think the LAST_VALUE should be the highest value in the windows or set of result.” I find this question very interesting because this is very commonly made mistake. No there is no bug in the code. I think what we need is a bit more explanation. Let me attempt that first. Before you do that I suggest you read yesterday’s blog post as this question is related to that blog post. Now let’s have fun following query: USE AdventureWorks GO SELECT s.SalesOrderID,s.SalesOrderDetailID,s.OrderQty, FIRST_VALUE(SalesOrderDetailID) OVER (ORDER BY SalesOrderDetailID) FstValue, LAST_VALUE(SalesOrderDetailID) OVER (ORDER BY SalesOrderDetailID) LstValue FROM Sales.SalesOrderDetail s WHERE SalesOrderID IN (43670, 43669, 43667, 43663) ORDER BY s.SalesOrderID,s.SalesOrderDetailID,s.OrderQty GO The above query will give us the following result: As per the reader’s question the value of the LAST_VALUE function should be always 114 and not increasing as the rows are increased. Let me re-write the above code once again with bit extra T-SQL Syntax. Please pay special attention to the ROW clause which I have added in the above syntax. USE AdventureWorks GO SELECT s.SalesOrderID,s.SalesOrderDetailID,s.OrderQty, FIRST_VALUE(SalesOrderDetailID) OVER (ORDER BY SalesOrderDetailID ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW) FstValue, LAST_VALUE(SalesOrderDetailID) OVER (ORDER BY SalesOrderDetailID ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW) LstValue FROM Sales.SalesOrderDetail s WHERE SalesOrderID IN (43670, 43669, 43667, 43663) ORDER BY s.SalesOrderID,s.SalesOrderDetailID,s.OrderQty GO Now once again check the result of the above query. The result of both the query is same because in OVER clause the default ROWS selection is always UNBOUNDED PRECEDING AND CURRENT ROW. If you want the maximum value of the windows with OVER clause you need to change the syntax to UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING for ROW clause. Now run following query and pay special attention to ROW clause again. USE AdventureWorks GO SELECT s.SalesOrderID,s.SalesOrderDetailID,s.OrderQty, FIRST_VALUE(SalesOrderDetailID) OVER (PARTITION BY SalesOrderID ORDER BY SalesOrderDetailID ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING) FstValue, LAST_VALUE(SalesOrderDetailID) OVER (PARTITION BY SalesOrderID ORDER BY SalesOrderDetailID ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING) LstValue FROM Sales.SalesOrderDetail s WHERE SalesOrderID IN (43670, 43669, 43667, 43663) ORDER BY s.SalesOrderID,s.SalesOrderDetailID,s.OrderQty GO Here is the resultset of the above query which is what questioner was asking. So in simple word, there is no bug but there is additional syntax needed to add to get your desired answer. The same logic also applies to PARTITION BY clause when used. Here is quick example of how we can further partition the query by SalesOrderDetailID with this new functions. USE AdventureWorks GO SELECT s.SalesOrderID,s.SalesOrderDetailID,s.OrderQty, FIRST_VALUE(SalesOrderDetailID) OVER (PARTITION BY SalesOrderID ORDER BY SalesOrderDetailID ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING) FstValue, LAST_VALUE(SalesOrderDetailID) OVER (PARTITION BY SalesOrderID ORDER BY SalesOrderDetailID ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING) LstValue FROM Sales.SalesOrderDetail s WHERE SalesOrderID IN (43670, 43669, 43667, 43663) ORDER BY s.SalesOrderID,s.SalesOrderDetailID,s.OrderQty GO Above query will give us windowed resultset on SalesOrderDetailsID as well give us FIRST and LAST value for the windowed resultset. There are lots to discuss for this two functions and we have just explored tip of the iceberg. In future post I will discover it further deep. Reference: Pinal Dave (http://blog.SQLAuthority.com) Filed under: Pinal Dave, PostADay, SQL, SQL Authority, SQL Function, SQL Query, SQL Scripts, SQL Server, SQL Tips and Tricks, T SQL, Technology

    Read the article

  • SQL WHERE clause not returning rows when field has NULL value

    - by JohnB
    Ok, so I'm aware of this issue: When SET ANSI_NULLS is ON, all comparisons against a null value evaluate to UNKNOWN SQL And NULL Values in where clause SQL Server return Rows that are not equal < to a value and NULL However, I am trying to query a DataTable. I could add to my query: OR col_1 IS NULL OR col_2 IS NULL for every column, but my table has 47 columns, and I'm building dynamic SQL (string concatenation), and it just seems like a pain to do that. Is there another solution? I was to bring back all the rows that have NULL values in the WHERE comparison. UPDATE Example of query that gave me problems: string query = col_1 not in ('Dorothy', 'Blanche') and col_2 not in ('Zborna', 'Devereaux') grid.DataContext = dataTable.Select(query).CopyToDataTable(); (didn't retrieve rows if/when col_1 = null and/or col_2 = null)

    Read the article

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