dataTables in phantomjs selecting latest created row using - javascript

I have created a dataTable in my shiny R app.Now I am making a automated testing tool for this App by using phantomJS.The login page has a dataTable to store the sessions of a particular user.The dataTable has three columns :- "userID","description" and "timeStamp". I need to select the latest row created from the dataTable probably by making a function.This can be done in my opinion by using the time stamp or row index.
Can I get some snippet and confirmation if that's the right thing to do?

Related

Show connection among multiple entity using JavaScript

I want to achieve tableau like UI on my page. Basically on page I have list of database table & user can select table to establish relationship with drag/drop & clicking on line which connects tables.
I am not sure what is the correct term & js framework help me to achieve that. for ref. I am attaching sample UI I have on Tableau. Here on picture i have 4 table where I can click on line for further operation.
Following are sample end result I am trying to achieve.

How do I display database rows on multiple pages with Ajax?

I have a database with a table having a big number of rows. I am fetching the data in this table and displaying it in an HTML table on a web page.
My requirement is to display 20 records initially and then when the user clicks a button labelled Next, I show the next 20 records and so on...
So I have initially fetched first 20 rows from the table in my PHP (server-side), and then assigned a JS function to the onclick attribute of the button labelled Next. Inside this JS function, I use an AJAX call which brings me the next 20 rows. Then within this JS function, I replace the HTML rows with these new rows.
I need something like this:
The question is that are there any plugins available which can implement that functionality for me? If a plugin is available, implementing it manually wouldn't make sense because being a rookie, I can't develop it better than the developers of that plugin.
Yes
This is called pagination - a quick search for "ajax pagination mysql php" or similar brings up a wide range of options. I can't recommend any particular one as your question is too broad; I can only reasonably go as far as a definition.
Internally they use the MySQL LIMIT keyword which may help give further things to search for or experiment with depending on your actual use case.

Programmatically setting the number of displayed rows in a Bootgrid table

Hi I'm writing a web app using rails and as part of it I am displaying data to the user using jQuery Bootgrid. As part of this the user is able to set the number of rows per page of the table. I'd like to be able to have this setting persist between page loads.
When a user chooses an option for the number of rows to display I am able to capture that and store in a model. However Bootgrid doesn't seem to have a simple way of programmatically setting the number of rows. This seems like a common thing to want to do so if anyone has come across this before and can give some help it would be greatly appropriated.
you can find a "setRowCount" implemented in
https://github.com/rstaib/jquery-bootgrid/issues/215 - jquery.bootgrid.modified.txt
Unfortunately the user didn't see fit to properly fork the repo.
Not my best code but it is working:
With jquery fire click event of number of rows that you want...
$("#grid-basic1-header .dropdown:visible [data-action='-1']").click();

Kibana - dashboard to find something and display nearby records from logs

I've configured ELK stack for our system (.NET application). It works good but in current configuration it's not convenient to search for some text and display results with nearby application logs in the table (for example, I want to trace how particular object was moving through functions in code).
I've made a dashboard that consists of a textbox, set of filters, a graph of events and two tables - one for search results and the second for all events.
The task I want to complete:
1) Enter the query in the search box
2) Display results in both the graph and the first table.
3) By clicking a point in the graph or a row in the table (or maybe a link in ID field) second table should display item with the same id as clicked AND all next records (up to the page limit of the table).
For now with the existing dashboard I can proceed with first two steps, but the third one is done manually by reducing the time period in the graph so that the table of events contains found record and several surrounding.
Can this be done in Kibana? Probably, I can write some javascript code to complete the task.
How could I filter the table with javascript to select a row by ID and also select PageLimit - 1 next reords?
Or another way could be to filter the table by time so that its range becomes from the time of selected event to (for example) next five minutes.
Is there any documentation with javascript API for Kibana?
Thanks in advance!
This is not built into kibana 3 nor the current version of kibana 4. My suggestion would be to edit the table display to add a new link to each row. The link could be populated with the object_id and date range (+/- 15 min, etc) and open a kibana page in a new window.
This would be based around the Templates and Scripts functionality.

How to sort gridview from client side without clicking on header

I have a grid-view on my web page but without headers.
I need to sort grid-view from client side.Using any button or drop-down list which has column name in data-text field and column index in data-value field.
I found a tutorial on this site
See Demo
This works fine for table.But it not working for grid-view.
Can any one tell me how can i use this on grid-view.
Following posts will give you some starting point about jQuery DataTables.
Building a complete ajax CRUD system with Asp.Net 1
ASP.NET and jQuery DataTables – The Basics 2

Categories

Resources