Search Results

Search found 1403 results on 57 pages for 'yui datatable'.

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

  • VB.Net Linq Datatable Exists

    - by LarsH
    I would like to use Linq instead of below function : Friend Function IsCollectionInTable2(ByVal apps As DataTable, ByVal collectionId As String) As Boolean For Each row As DataRow In apps.Rows If row("CollectionId").ToString = collectionId Then Return True Next Return False End Function The best I can do is below: Friend Function IsCollectionInTable(ByVal apps As DataTable, ByVal collectionId As String) As Boolean Return (From row In apps.AsEnumerable() Where (row.Field(Of String)("CollectionId") = collectionId) Select row.Field(Of String)("CollectionId")).Count > 0 End Function I would like to use Exists or Any in above function. Performance could be an issue,

    Read the article

  • Alternatives of Datatable

    - by mavera
    In my web application, I have a dynamic query that returns huge data to datatable, and this query is often recalled with different parameters. So database is exhausted. I want to get all record with no parameters to an object, and perform queries (may be with linq) on this object. So database will not be exthausted. Which objects can be used instead of datatable?

    Read the article

  • Usar un Datatable como fuente de datos para un GridView

    - by Jason Ulloa
    Es común ver en los foros, preguntas sobre como llenar un datatable para luego, ponerlo como fuente de un GridView. En nuestro próximo ejemplo, mostraremos lo sencillo que puede ser y la poca cantidad de código que es requerida: using (SqlConnection c = new SqlConnection("conectionstring")) { c.Open(); // Crear un nuevo DataAdapter using (SqlDataAdapter a = new SqlDataAdapter("SELECT * FROM table", c)) { // Usar un DataAdapter para llenar el DataTable DataTable t = new DataTable(); a.Fill(t);   gridView1.DataSource = t; gridView1.DataBind();   } }

    Read the article

  • <rich:datatable> and <rich:datascroller> problem

    - by Bariscan
    Hi all, I am developing a Seam-Jsfv1.2-EJB3 web app. I have a datatable and checkboxes in each row. Moreover, I have a datascroller at the bottom of my table as well. My problem is when I click the next page number from the scroller, the selected checkboxes at the first page of the datatable is gone. I mean, even if they were selected, clicking the next page make them deselected. I see it by going back to the first page again by clicking the scroller. Do you have any idea about that problem? In order to clearify my case, I attached my code below: <rich:dataTable id="apiV2ProductList" rows="10" var="_apiV2Product" value="#{apiV2ProductList.resultList}" rendered="#{not empty apiV2ProductList.resultList}" reRender="ds"> <rich:column> <f:facet name="header"> <h:selectBooleanCheckbox id="selectionCheckAll" onclick="selectAll()" /> </f:facet> <h:selectBooleanCheckbox id="selectionCheck" onclick="increase(this)" value="#{_apiV2Product.selectValue}" > </h:selectBooleanCheckbox> </rich:column> ... <f:facet name="footer"> <rich:datascroller id="ds" renderIfSinglePage="false"> </rich:datascroller> </f:facet> Many thanks in advance. Baris

    Read the article

  • Printing a DataTable to textbox/textfile in .NET

    - by neodymium
    Is there a predefined or "easy" method of writing a datatable to a text file or TextBox Control (With monospace font) such as DataTable.Print(): Column1| Column2| --------|--------| v1| v2| v3| v4| v5| v6| Edit Here's an initial version (vb.net) - in case anyone is interested or wants to build their own: Public Function BuildTable(ByVal dt As DataTable) As String Dim result As New StringBuilder Dim widths As New List(Of Integer) Const ColumnSeparator As Char = "|"c Const HeadingUnderline As Char = "-"c ' determine width of each column based on widest of either column heading or values in that column For Each col As DataColumn In dt.Columns Dim colWidth As Integer = Integer.MinValue For Each row As DataRow In dt.Rows Dim len As Integer = row(col.ColumnName).ToString.Length If len > colWidth Then colWidth = len End If Next widths.Add(CInt(IIf(colWidth < col.ColumnName.Length, col.ColumnName.Length + 1, colWidth + 1))) Next ' write column headers For Each col As DataColumn In dt.Columns result.Append(col.ColumnName.PadLeft(widths(col.Ordinal))) result.Append(ColumnSeparator) Next result.AppendLine() ' write heading underline For Each col As DataColumn In dt.Columns Dim horizontal As String = New String(HeadingUnderline, widths(col.Ordinal)) result.Append(horizontal.PadLeft(widths(col.Ordinal))) result.Append(ColumnSeparator) Next result.AppendLine() ' write each row For Each row As DataRow In dt.Rows For Each col As DataColumn In dt.Columns result.Append(row(col.ColumnName).ToString.PadLeft(widths(col.Ordinal))) result.Append(ColumnSeparator) Next result.AppendLine() Next Return result.ToString() End Function

    Read the article

  • YUI Compressor + gzip causes Illegal Character error in jQuery

    - by lo_fye
    When I minify jquery using YUI compressor, it works fine. When I then add gzip compression (and serve this version via mod rewrite), the gzipped version throws this error: illegal character in jquery.min.js on line 1 Line 1 is: ???????M???????????s?8?0???!sz?dKr?=? This results in a "jquery is not defined" error. I am using the following rewrite rules to serve up the gzipped versions: #Check to see if browser can accept gzip files. ReWriteCond %{HTTP:accept-encoding} (gzip.*) #make sure there's no trailing .gz on the url ReWriteCond %{REQUEST_FILENAME} !^.+\.gz$ #check to see if a .gz version of the file exists. RewriteCond %{REQUEST_FILENAME}.gz -f #All conditions met so add .gz to URL filename (invisibly) RewriteRule ^(.+) $1.gz [L] I can't find any references to this happening to anyone else. Thoughts?

    Read the article

  • YUI (JS): Putting a MenuBar in a Panel

    - by John Bentley
    If I put a YUI menu bar in the body it works perfectly. However if I use it inside of a Panel it shows up without the proper background. It is larger than it should be. Other than the default sam skin I'm using only the following css. .windowbody is the class of the panel. <style type="text/css"> body { margin: 0; } .windowbody { overflow: auto; padding: 0; } .windowbody div { padding: 0; margin: 0; } </style>

    Read the article

  • Can't get YUI animations to wait until the first has finished

    - by Andy Cairns
    Hi there, I have 3 animations that run when I load my page. A header descends from the top and a footer ascends from the bottom. Also, my main logo goes from fully transparent to fully opaque. I'm using the YUI framework for the animations. My problem is that they all happen at the same time. I'd like the header & footer animations to go at the same time but the logo to wait until the others have finished. setTimeout doesn't appear to work (the animation triggers immediately). I've also tried a while loop to wait until the currentFrame = a certain number but my loops seem to stop everything from working. Any help would be gratefully received. Thanks Andy

    Read the article

  • debug javascript in release mode with yui compressions

    - by mickyjtwin
    In our build scripts, we are using YUI compressor to minify/compress javascript and css files. As this combines the js into one file, it needs to be referenced in the Master Layout script, e.g. First question is what is best way to use both, so that if we are developing (in debug mode) it will reference each js file individually? Second question, is once on production, would there be any steps/solution to debugging the javascript on the production server, i.e. conditionallly load the javascript files based on setting a "debug=true" setting in either js or .net?

    Read the article

  • Getting data into an input field from YUI Calendar with multi-select:true

    - by kylex
    <script type="text/javascript"> YAHOO.util.Event.onDOMReady(function(){ YAHOO.dateSelects.exc = new YAHOO.widget.Calendar("exc","excContainer", { title:"Choose a date:", close:true, multi_select:true }); YAHOO.dateSelects.exc.render(); YAHOO.util.Event.addListener( "excshowup", "click", YAHOO.dateSelects.exc.show, YAHOO.dateSelects.exc, true ); }); </script> <div class="calendarOuterContainer"> <div id="excContainer" class="calendarContainer"></div> </div> <a id="excshowup"><img src="/images/icons/calendar.png" /></a> The preceding code generates a YUI calendar with the ability to select multiple dates on one calendar. What I am having trouble figuring out is how to capture that data and place it inside a text input tag on the fly. So when a person clicks the close button, all the selected dates are populated inside the input tag. Suggestions?

    Read the article

  • YUI Calendar: how does it load the Sam's Skin CSS?

    - by dound
    I'm using YUI 2's calendar in YUI 3. How does it load Sam's skin CSS? I didn't manually include it (though it seems like I should so the user can download it in the one request I make to the combo loader for css). Strangely, I don't see it being downloaded nor do I see it in the JS files themselves. I must be overlooking it. This is how I'm loading the CSS and JS now: <head> ... <link rel="stylesheet" type="text/css" href="http://yui.yahooapis.com/combo?3.1.0/build/cssreset/reset.css&amp;3.1.0/build/cssfonts/fonts.css&amp;3.1.0/build/cssbase/base.css"/> ... </head> ... <!--and at the end of the body tag:--> <script type="text/javascript" src="http://yui.yahooapis.com/combo?3.1.1/build/yui/yui-min.js&amp;3.1.1/build/oop/oop-min.js&amp;3.1.1/build/event-custom/event-custom-base-min.js&amp;3.1.1/build/event/event-base-min.js&amp;3.1.1/build/json/json-parse-min.js&amp;3.1.1/build/querystring/querystring-stringify-simple-min.js&amp;3.1.1/build/io/io-base-min.js&amp;3.1.1/build/dom/dom-base-min.js&amp;3.1.1/build/dom/selector-native-min.js&amp;3.1.1/build/dom/selector-css2-min.js&amp;3.1.1/build/node/node-base-min.js&amp;3.1.1/build/node/node-style-min.js&amp;3.1.1/build/stylesheet/stylesheet-min.js&amp;2in3.1/2.8.0/build/yui2-calendar/yui2-calendar-min.js&amp;2in3.1/2.8.0/build/yui2-yahoo/yui2-yahoo-min.js&amp;2in3.1/2.8.0/build/yui2-dom/yui2-dom-min.js&amp;2in3.1/2.8.0/build/yui2-event/yui2-event-min.js"></script> <script type="text/javascript">//<![CDATA[ YUI().use('yui2-calendar', function(Y) { var YAHOO = Y.YUI2; var cal = new YAHOO.widget.Calendar("cal",{navigator:true,mindate:'1/1/2000'); cal.render(); // ... Edit: I want to make a few minor changes to the default sam skin. What is the best way to do that? I answered this part of my question. If I wrap the calendar in an extra div, then specifying CSS rules which include that div as part of the selector makes the rule more specific so the browser uses it over Sam's skin. Rough example: <style type="text/css"> .magic .yui-skin-sam .yui-calendar td.calcell { height: 10em; width: 15em; } </style> ... <div class="magic"> <div class="yui-skin-sam"> <div id="cal"></div> </div> </div>

    Read the article

  • Ruby on Rails DataTable now working.

    - by Nimroo
    [Ruby on Rails DataTable guide][1]https://github.com/phronos/rails_datatables/blob/master/README.md I"m following the above and have installed the git plugin as well. All i'm getting is the <%= datatable() % returning " <script type="text/javascript"> $(function() { $('#expenses').dataTable({ "oLanguage": { "sSearch": "Search", "sProcessing": 'Processing' }, "sPaginationType": "full_numbers", "iDisplayLength": 25, "bProcessing": true, "bServerSide": false, "bLengthChange": false, "bStateSave": true, "bFilter": true, "bAutoWidth": true, 'aaSorting': [[0, 'desc']], "aoColumns": [ { 'sType': 'html', 'bSortable':true, 'bSearchable':true ,'sClass':'first' },{ 'sType': 'html', 'bSortable':true, 'bSearchable':true },{ 'sType': 'html', 'bSortable':true, 'bSearchable':true },{ 'sType': 'string', 'bSortable':true, 'bSearchable':true ,'sClass':'last' } ], "fnServerData": function ( sSource, aoData, fnCallback ) { aoData.push( ); $.getJSON( sSource, aoData, function (json) { fnCallback(json); } ); } }); }); </script>". My .html.erb looks like this: <% @page_title="User Page"%> <link rel="stylesheet" href="http://code.jquery.com/ui/1.9.2/themes/base/jquery-ui.css" /> <script src="http://code.jquery.com/jquery-1.8.3.js"></script> <script src="http://code.jquery.com/ui/1.9.2/jquery-ui.js"></script> <%=javascript_include_tag "jquery.dataTables" %> <%=stylesheet_link_tag "jquery-ui-1.9.2.custom" %> <script> $(function() { $( "#tabs" ).tabs(); }); </script> <% if current_user %> <div id="tabs"> <ul> <li><a href="#tabs-1">Expenses</a></li> <li><a href="#tabs-2">Accountant</a></li> <li><a href="#tabs-3">Requests (<%[email protected]%>)</a></li> </ul> <div id="tabs-3"> <p> <% if @requests.count != 0 %> <h2> Accountant Requests </h2> <table > <tr> <thead> <th>First Name</th> <th>Last Name</th> <th>Email Address</th> <th>Accept</th> <th>Reject</th> </thead> </tr> <% @requests.each do |request| %> <tr> <td><%= request.accountant.first_name %></td> <td><%= request.accountant.last_name %></td> <td><%= request.accountant.email %></td> <td><%= link_to 'accept', confirm_accountant_path(:accountant_id => request.accountant_id) %></td> <td><%= link_to 'Edit', edit_expense_path(request) %></td> </tr> <% end %> </tbody> </table> <% else %> <h4> You have no pending requests <h4> <% end %> </p> </div> <div id="tabs-2"> <p> <% if @accountants.count != 0 %> <h2> Accountant Info </h2> <table> <tr> <th>First Name</th> <th>Last Name</th> <th>Email Address</th> </tr> <% @accountants.each do |accountant| %> <tr> <td><%= accountant.first_name %></td> <td><%= accountant.last_name %></td> <td><%= accountant.email %></td> </tr> <% end %> </table> <% else %> <h4> Add Accountant <h4> <p> You don't have an accountant yet, perhaps consider adding one by e-mail </p> <%= render 'add_accountant_form' %> <% end %> <% end %> </p> </div> <div id="tabs-1"> <p><% if current_user %> <h4> Submit new expense </h4> <%= render 'expenses/form' %> <% columns = [{:type => 'html', :class => "first"}, {:type => 'html'}, {:type => 'html'}, {:type => nil, :class => "last"}] %> <%= datatable(columns, {:sort_by => "[0, 'desc']", table_dom_id:"expenses" }) %> <table id="expenses" class="datatable"> <thead> <tr> <th>Entry Date</th> <th>Last Update</th> <th>Amount</th> <th>User</th> <th>Receipt</th> <th></th> <th></th> </tr> </thead> <% @expenses.each do |user_expense| %> <tbody> <tr> <td><%= user_expense.created_at %></td> <td><%= user_expense.updated_at %></td> <td><%= user_expense.amount %></td> <td><%= user_expense.user.username %></td> <% if !user_expense.receipt_img.nil? %> <td><%= image_tag user_expense.receipt_img.url(:thumb) %></td> <% else %> <td>Future Button Here</td> <% end %> <td><%= link_to 'Show', user_expense %></td> <td><%= link_to 'Edit', edit_expense_path(user_expense) %></td> </tr> </tbody> <% end %> </table> <% end %></p> </div> </div>

    Read the article

  • YUI "Get" utility to parse JSON response?

    - by Sean
    The documentation page for the YUI "Get" utility says: Get Utility is ideal for loading your own scripts or CSS progressively (lazy-loading) or for retrieving cross-domain JSON data from sources in which you have total trust. ...but doesn't have any actual examples for how to do so. Their one example doesn't actually request a JSON document from a remote server, but instead a document containing actual JavaScript along with the JSON data. I'm just interested in the JSON response from the Google Maps API HTTP (REST) interface. Because I can't do cross-site scripting with the "Connect" utility, I am trying the "Get" utility. But merely inserting some JSON data into the page isn't going to do anything, of course. I have to assign it to a variable. But how? Also, just inserting JSON data into the page makes Firefox complain that there's a JavaScript error. And understandably! Plain ol' JSON data isn't going to parse as valid JavaScript. Any ideas?

    Read the article

  • How to lazy load scripts in YUI that accompany ajax html fragments

    - by Chris Beck
    I have a web app with Tabs for Messages and Contacts (think gmail). Each Tab has a Y.on('click') event listener that retrieves an HTML fragment via Y.io() and renders the fragment via node.setContent(). However, the Contact Tab also requires contact.js to enable an Edit button in the fragment. How do I defer the cost of loading contact.js until the user clicks on the Contacts tab? How should contact.js add it's listener to the Edit button? The Complete function of my Tab's on('click') event could serialize Get.script('contact.js') after Y.io('fragment'). However, for better performance, I would prefer to download the script in parallel to downloading the HTML fragment. In that case, I would need to defer adding an event listener to the Edit button until the Edit button is available. This seems like a common RIA design pattern. What is the best way to implement this with YUI? How should I get the script? How should I defer sections of the script until elements in the fragment are available in the DOM?

    Read the article

  • DataTables warning (table id = 'example-advanced'): Cannot reinitialise DataTable while using treetable and datatable at the same time

    - by Nyaro
    DataTables warning (table id = 'example-advanced'): Cannot reinitialise DataTable while using treetable and datatable at the same time. Here is my code: <script src="jquery-1.7.2.min.js"></script> <script src='jquery.dataTables.min.js'></script> <script src="jquery.treetable.js"></script> <script> $("#example-advanced").treetable({ expandable: true }); </script> <script> $('#example-advanced').dataTable( { "bSort": false } ); </script> Actually I wanted to get rid of the sorting part of the datatable coz it was giving error in treetable display so i want the sorting part from the datatable out and keep other functions like search and pagination. Please help me out. Thanks in advance.

    Read the article

  • Fastest way to convert datatable to generic list

    - by Joel Coehoorn
    I have a data tier select method that returns a datatable. It's called from a business tier method that should then return a strongly typed generic List. What I want to do is very similar (but not the same as) this question: http://stackoverflow.com/questions/208532/how-do-you-convert-a-datatable-into-a-generic-list What's different is that I want the list to contain strongly-typed objects rather than datarows (also, I don't have linq avaiable here yet). I'm concerned about performance. The business tier method will in turn be called from the presentation tier, and the results will be iterated for display to the user. It seems very wasteful to add an extra iteration at the business tier, only do it again right away for the presentation, so I want this to be as quick as possible. This is a common task, so I'm really looking for a good pattern that can be repeated over and over.

    Read the article

  • how to serialize a DataTable to json or xml

    - by loviji
    Hello, i'm trying to serialize DataTable to Json or XML. is it possibly and how? any tutorials and ideas, please. For example a have a sql table: CREATE TABLE [dbo].[dictTable]( [keyValue] [int] IDENTITY(1,1) NOT NULL, [valueValue] [int] NULL, CONSTRAINT [Psd2Id] PRIMARY KEY CLUSTERED ( [keyValue] ASC )WITH (PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY] ) ON [PRIMARY] C# code: string connectionString = "server=localhost;database=dbd;uid=**;pwd=**"; SqlConnection mySqlConnection = new SqlConnection(connectionString); string selectString = "SELECT keyValue, valueValue FROM dicTable"; SqlCommand mySqlCommand = mySqlConnection.CreateCommand(); mySqlCommand.CommandText = selectString; SqlDataAdapter mySqlDataAdapter = new SqlDataAdapter(); mySqlDataAdapter.SelectCommand = mySqlCommand; DataSet myDataSet = new DataSet(); mySqlConnection.Open(); string dataTableName = "dictionary"; mySqlDataAdapter.Fill(myDataSet, dataTableName); DataTable myDataTable = myDataSet.Tables[dataTableName]; //now how to serialize it?

    Read the article

  • How to bind DataTable to Chart series?

    - by user175908
    Hello, How to do bind data from DataTable to Chart series? I get null reference exception. I tried binding with square brackets and it did not worked either. So, how to do the binding? Thanks. P.S: I included DataGrid XAML and CS which works just fine. Converting data to List<KeyValuePair<string,int>> works good but it is kinda slow and is unnessesary trash in code. I use WPFToolkit (the latest version). XAML: <Window x:Class="BindingzTest.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Title="MainWindow" Height="606" Width="988" xmlns:charting="clr-namespace:System.Windows.Controls.DataVisualization.Charting;assembly=System.Windows.Controls.DataVisualization.Toolkit"> <Grid Name="LayoutRoot"> <charting:Chart Title="Letters and Numbers" VerticalAlignment="Top" Height="400"> <charting:Chart.Series> <charting:ColumnSeries Name="myChartSeries" IndependentValueBinding="{Binding Letter}" DependentValueBinding="{Binding Number}" ItemsSource="{Binding}" /> </charting:Chart.Series> </charting:Chart> <DataGrid Name="myDataGrid" VerticalAlignment="Stretch" Margin="0,400,0,50" ItemsSource="{Binding}" AutoGenerateColumns="False"> <DataGrid.Columns> <DataGridTextColumn Header="Letter" Binding="{Binding Letter}"/> <DataGridTextColumn Header="Number" Binding="{Binding Number}"/> </DataGrid.Columns> </DataGrid> <Button Content="Generate" HorizontalAlignment="Left" Name="generateButton" Width="128" Click="GenerateButtonClicked" Height="52" VerticalAlignment="Bottom" /> </Grid> CS: public partial class MainWindow : Window { public MainWindow() { InitializeComponent(); } DataTable GenerateMyTable() { var myTable = new DataTable("MyTable"); myTable.Columns.Add("Letter"); myTable.Columns.Add("Number"); myTable.Rows.Add("A", 500); myTable.Rows.Add("B", 400); myTable.Rows.Add("C", 500); myTable.Rows.Add("D", 600); myTable.Rows.Add("E", 300); myTable.Rows.Add("F", 200); return myTable; } private void GenerateButtonClicked(object sender, RoutedEventArgs e) { var myGeneratedTable = GenerateMyTable(); myDataGrid.DataContext = myGeneratedTable; myChartSeries.DataContext = myGeneratedTable; // Calling this throws "Object reference not set to an instance of an object" exception } }

    Read the article

  • Problem with the DataTable and DataGridView objects

    - by Karol
    Hello everyone, I have the following problem In my aplication I doing some calculations and after it put them into DataTable object (6 columns, data in the latest one is most important). To view the results I put them into DataGridView object and there is my problem. Depending on the data contained in the last column I want to mark the cells on the appropriate colors. And I don't know if I should do this on the DataGridView object because this is user interfaces? Where I can do this? DataTable object doesn't have a style properties? Thanks a lot...

    Read the article

  • Filter DataTable to show only the most recent transaction for each user

    - by Dan Neely
    I have a datatable that contains rows of transaction data for multiple users. Each row includes UserID and UserTransactionID columns. What would I use for as a RowFilter in the tables DefaultView to only show the row for each user that has the highest UserTransactionID value? sample data and results UserID UserTransactionID PassesFilter 1 1 False 1 2 False 1 3 True 2 1 True 3 1 False 3 2 True My data is orginating in a non-SQL source, the DataTable is being created to be bound to a DataGridView so I can't make changes to a query being used to get the data initially.

    Read the article

  • Populate DataTable with LINQ in C#

    - by RaYell
    I have a method in my app that populates DataTable with the data using the following code: DataTable dt = this.attachmentsDataSet.Tables["Attachments"]; foreach (Outlook.Attachment attachment in this.mailItem.Attachments) { DataRow dr = dt.NewRow(); dr["Index"] = attachment.Index; dr["DisplayName"] = String.Format( CultureInfo.InvariantCulture, "{0} ({1})", attachment.FileName, FormatSize(attachment.Size)); dr["Name"] = attachment.FileName; dr["Size"] = attachment.Size; dt.Rows.Add(dr); } I was wondering if I could achieve the same functionality using LINQ in order to shorten this code a bit. Any ideas?

    Read the article

  • DataView Vs DataTable.Select()

    - by Aseem Gautam
    Considering the code below: Dataview someView = new DataView(sometable) someView.RowFilter = someFilter; if(someView.count > 0) { …. } Quite a number of articles which say Datatable.Select() is better than using DataViews, but these are prior to VS2008. Solved: The Mystery of DataView's Poor Performance with Large Recordsets Array of DataRecord vs. DataView: A Dramatic Difference in Performance So in a situation where I just want a subset of datarows based on some filter criteria(single query) and what is better DataView or DataTable.Select()?

    Read the article

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