I'm using Mottie's Tablesorter, and it's ideal for what I need!
However I can't figure out how (or if it's even possible) to put the "reset search" button inside one of the table headers (where a filter would usually be).
I have a jsfiddle here of it working with the reset button outside of the table: http://jsfiddle.net/OPSJono/1dpd1a6y/4/
This is the part of the JS that determines what goes into the filter table header row. But I can't seem to find a way to put a button in there.
This code currently returns nothing into that cell (as filter_reset doesn't exist)
6: function ($cell, indx) {
return $.filter_reset;
}
However I would like the reset button inside the "actions" header.
I've looked around and can't find anyone else who's put the reset button inside of a filter header before.
Any help or a point in the right direction would be appreciated!
Through trial and error I found a way to do it!!
6 : function($cell, indx) {
return $cell.html('<button type="button" class="reset">Reset Search</button>');
}
Just returning HTML code into the Cell.
Seems pretty obvious now that I've figured it out!
Related
I would like to refresh a single cell in ag-grid. Using the gridApi.refreshCells().
This refresh is called by a piece of code that keeps track of the current and previous cell.
So what i would like to do it is to update the previous cell.
I tried the following:
gridApi.refreshCells({columns: [prevColumn], rowNodes: [prevRowNode]});
Note that the prevColumn is of type "Column" and prevRowNode is of type "RowNode"
Calling this works, except that it will refresh an entire column and not just a single cell.
Also refreshing a single row is also not working, which when modifying the above to just use the rowNodes will still update the column.
Thanks you guys!
I'm not sure exactly what you are aiming for. To refresh one cell have you tried gridApi.applyTransaction?
https://www.ag-grid.com/javascript-grid/data-update-transactions/
Specifically the example:
https://www.ag-grid.com/javascript-grid/data-update-transactions/#example-updating-with-transaction
If this isn't what you need, please could you provide a plunker demonstrating the issue?
I know that the title of asking is quite vague. But let's check this page:
https://www.cleaneye.go.kr/user/gongsiCompare.do
So this is one of public data page in Korea which has a data I need in my research.
As you can see, it has some checkbox in ul, and if you check one of the box in left one, the list of checkbox on its right would come up.
So I made a code to check every combinations, and I'll show you the one which cause the problem.
from selenium import webdriver
driver = webdriver.Chrome(CHROMEDRIVER_LOCATION)
driver.get('https://www.cleaneye.go.kr/user/gongsiCompare.do')
in_type = driver.find_elements_by_xpath("//div[#id='divPcomp']/ul/li")
for in_t in in_type:
in_t.find_element_by_xpath("./label/input").click()
region_type = driver.find_elements_by_xpath("//div[#id='divSido']/ul/li")
for r_t in region_type:
r_t.find_element_by_xpath("./label/input").click()
The problem is, when the code execute
r_t.find_element_by_xpath("./label/input").click()
it gives ElementNotInteractableException error, maybe cuz DOM didn't revised after it clicked the checkbox in
in_t.find_element_by_xpath("./label/input").click()
So I've searched how to solve this problem, and most of answers were about using implicit/explicit wait. Before I do that, I put time.wait(30) between click()s, and still it didn't work. So just waiting might not be the solution for this.
As you can see, if you refresh it, the whole page would be reset so... that is not the answer for this as well.
Is there any great solution, or any walk-around it, please enlighten me.
Otherwise, I'll just use mouseclick and keyboard inputting 'tab' haha...
Thanks for your attention to this problem!
your locator is not unique, it finds element that is not visible on screen use :
region_type = driver.find_elements_by_xpath("//div[#id='divSido']/ul/li[#class='rowon']")
I want to add empty data row. My requirement is like columns are dynamic. I have tried using dtInstance to add the row. it's throwing some error.
here is the link
https://stackblitz.com/edit/how-to-replace-all-the-columns-dynamically-in-data-table-gvfose?file=app/app.component.ts
Please let me know if more details required.
I dont think that's possible with Angular-datatables out of the box, but you can use Angular-xeditable to achieve that as in this question. A better way to do it in my humble opinion would be, when the user clicks the 'add' button, we show a pop-up, they fill the data, we update the back-end or the reference table and rerender the table.
You gave the Data table wrong model. you are mixing between different models in your code.
I've fixed it as well adding two empty rows, make sure to align with the model defined by columnsDataObj
https://stackblitz.com/edit/how-to-replace-all-the-columns-dynamically-in-data-table-zemuq2?file=app/app.component.ts
There is a simple demo for your requirement that puts the other button to save the empty column you want to access the data.
For easy to use, add DATA button that would be shown the blank row with input, the style you desire to set up the CSS and don't forgot the CSS scope for your by Encapsulation.
DEMO
If the operation field is superfluous, rid it off and place the event for three columns after entering with your logical condition.
Annoying Button
The add DATA could be replaced with the below code, setup the life hook instead for insert the method in the constructor.
ngAfterViewInit (){
this.addData();
}
I am using this plugin called X-Editable.
A little stuck on how to accomplish this so I figured I would see if anyone else has used it or knows what to do.
Here is what my Page looks like:
screenshot http://imageshack.us/a/img850/4817/yko7.png
You can simply click on the text and it will allow you to edit it right there and there.
Now, as my end result, all I am trying to do is get the values from each of the rows but cant seem to figure it out.
Per the doc, I set my code up like the section here: "Creating new record". I just dont know how to get the values or the object when I click on my button.
Anyone had any experience with this?
Here you go.
http://jsfiddle.net/8vTPL/1/
This should at least get you going in the right direction. This example uses basic jQuery concepts to loop through collections. In your case, you want to loop through all of your table rows (line 7):
$('#tbl_values tbody tr').each(function(ix,obj...
get the id of each row/record (line 8):
$(obj).attr('id')
then loop through each table-data and x-editable element per that row (line 9):
$(obj).children('td').children('.editable').each(function(e_ix,e_obj...
get the id of each column/field (line 10):
$(e_obj).attr('id')
and get the value of each x-editable element in the row (line 11):
$(e_obj).editable('getValue')[$(e_obj).attr('id')]
Alternatively, you could just get the object that X-editable stores as the value:
$(e_obj).editable('getValue')
Hope this helps.
Im looking for a way to render an html table as an editable datgrid, with the ability to clone individual rows. I dont need to save any of the changes made, just superficially edit the cells because i then use a jquery plugin to scrape the table as is on screen and save it.
Ive tried jeditable, but its designed for posting the output of its edits to a page, not just superficially making the changes.
Ideally, i could control what types of inputs are displayed onclick based on what column they are on. The table cells are unnamed. If they need to be named, there are a total of 34 columns, so i would need to know how to name those individually.
Thanks in advance.
Jeditable's target can be a function (see the "Submitting to function instead of URL" section of the jeditable homepage) - you could pass an empty handler and use it.
[Edit]
The handler should return a string (that will be displayed on the page)
(taken from the example page)
$('#test').editable(function(value, settings) {
return(value);
}, {
type : 'textarea',
submit : 'OK',
});
It work nicely, I just tried it out.
[/Edit]