Is there a way to get a list of hidden column - bootstrap-table

I want to save the list of hidden columns so that next time when the table is loaded I show the table with the same set of column which the user chose to see in the past. Is there a way to get a list of all hidden columns in bootstrap-table library.

You can use the cookie extension to solve your problem, here is an example: http://issues.wenzhixin.net.cn/bootstrap-table/#extensions/cookie.html.
The plugin saves:
Sort order
Page number
Page number from the list
Visible columns
Search text
Docs here: http://bootstrap-table.wenzhixin.net.cn/extensions/#table-cookie

you can use the jquery datatables plugin to easily handle this problem, this plugin auto generate the table columns and show that.
you will get more information from link below,
https://www.datatables.net/
hope it helps.

try this below
var tab = $('#table').bootstrapTable('getHiddenColumns');
$.each(tab, function(index, value) {
alert(value.title);
})

Related

Add a search field by header using PeopleSoft

I’m looking to add search fields in each table header automatically using peoplesoft.
Example
Javascript solution:
add an html area to your page (with rec field)
assign via peoplecode an html object to the field
use something like this Javascript Filter on the table
For this to work well, your grid needs to show all rows and not paginate.
If it paginates and you need to keep the pagination, then you need to go for the PS solution:
Add one search field per header you want to search
On the fieldchange you perform a rowset flush then .Select(" WHERE ...") to populate it based on the filter

Dynamic data population like stackoverflow comments?

I'm trying to create a comment system just like SO has, but first, I'd like to show first 5 comments for a post and show rest if "display all comments" is clicked for the desired reply.
What is the best way of doing this? I really couldn't found a good way for doing what I want. I must be missing something.
For info, comments datasource is a nested repeater in my page. The outer repeater is replies and inner repeater is comments. Currently I'm binding all comments for all results (even if it has 10000 replies.). Also, I don't want to do paging for comments. I just want it to work the same way as SO.
Any ideas?
EDIT: Now I'm thinking of having 2 tables for comments which are:
A table which only has 5 rows of data and will be visible by default. I need filtering to do this. Linq filtering code would be great!
A table which has all the results. No filtering. I have no problems with this one.
So here is what I have for the data:
DataRowView dv = e.Item.DataItem as DataRowView;
if (dv != null)
{
Repeater commentRepeater = e.Item.FindControl("childRepeater") as Repeater;
if (commentRepeater != null)
{
commentRepeater.DataSource = dv.CreateChildView("myrelation");
commentRepeater.DataBind();
}
}
As you can see, I have created a relation between tables in my dataset and I'm binding that datarow to my repeater. I need to do top 5 filtering on the datarow.
Thank you
I suggest to use JSON returned from ASP.NET Web Services with jQuery.
http://www.mikesdotnetting.com/Article/96/Handling-JSON-Arrays-returned-from-ASP.NET-Web-Services-with-jQuery
http://www.electrictoolbox.com/json-data-jquery-php-mysql/
If you want to append the left over items to the current repeater item you could have a button at the end of the coments that is attached to a jquery function that will fetch the rest of the comments for you. Then once the data is recieved your function would just append the comments to the list of other comments mimicing what the repeater was doing and replacing the 'show all' button.
If you don't want to use any ajax to do this then you will probably need to rebind the comments Repeater with a new set of data that is not limited to just the first 5 results.
EDIT: Based on your comment and changes you have editted, I would go with one table with all comments and in the DataBinding of each comment set the row style to visible with a global counter. Once your have more than 5 set the style to a hidden style for each item. When they click the show all button, just switch the style from hidden to visible for the rest comments that are hidden. This will save you duplicating the data for the first 5 items which could turn into a lot of extra rows if there are a lot of answers with comments.

Create a (edit) hyperlink in front of dropdownbox with jQuery

I have a table with some data. All data is contained in dropdownboxes and textbox. But it isn't easy to see, what is newly written input and what is data from the database.
So I want to create a (edit) after these boxes, and replace the boxes with a literal where the contained value in the dropdownbox stands. When the edit-button is pushed the literal goes away and the dropdownbox appears instead, so it is possible to edit the data. This is all, the jQuery don't have to save the data to database, I have functionality to that in a save-button.
I don't want to use any extra plugin to jQuery, because it seems to be a fairly simpel task.
Any good ideas?
Thw whole code i cant write here, change as your wish.I didn't clear your question.
try this
when click edit
$(document).ready(function(){
$(".edit").click(){
$(".dropdown").show("slow");
$(".edit").hide("slow");
});
stylesheet.css
.dropdown
{
display:none;
}
after edit just reverse the code;

Flex : Displaying the Advanced DataGrid data in Pages

I have a flex application where Im displaying login data using an advanced datagrid. Is it possible to show the data in this advanced datagrid, by a page wise way? if so do you have any sample coding to do this. thanks
Here's an example I think might help you: http://gurufaction.blogspot.com/2007/02/flex-datagrid-paging-example-with.html
SWF: http://develop.gurufaction.com/App.swf
MXML: http://develop.gurufaction.com/src/App.mxml
You can use the "filterFunction".
Write a custom function to filter data according on which "page" you are browsing.
Another solution is to split the original array to get several array which will be assigned according to the current page.

How do I customize the print layout of a SharePoint list item?

i need to be able to produce a "pretty" printout of an individual list item's values, with the goals being:
get rid of all navigation
organize data as it would appear on a typical paper form (a customer requirement)
i'm avoiding using InfoPath at this time due to other issues (which i'll post separate questions for...)
for example, i have an individual list item that normally displays similar to the following DispForm.aspx example:
i need a printed version (PrintForm.aspx??) that will display similar to the following example:
from what i can tell, i can't do this just by modifying/creating custom CSS.
it also seems that i can't quite do this just by creating my own "print" version of DispForm.aspx.
any suggestions, ideas, links would be very helpful.
Creating a custom list form is probably what you want. Without the master page attached to it or anything.
You can find a walkthrough here that will get you started:
http://office.microsoft.com/en-us/sharepointdesigner/HA101191111033.aspx
Enjoy.
You could use CSS to hide all the navigation etc. that you don't need using a media="print" stylesheet, but you won't be able to make the exact changes to the layout you've illustrated.
If it doesn't have to be exactly like the example, it would be fairly trivial to hide all but the name->value table and just print that. If you really do need to merge fields and re-layout the table then you likely have to hack up the server-side.
Why can't you create your own version of the page?
Using Sharepoint Designer, you could create a custom aspx page that uses a dataview webpart to do this...
#mortenbpost's link was just what i needed:
Create a new page that contains a custom list form
specifically, here's what you need to do to get a "basic" custom page for a list item -- from which you can completely customize it with XHTML/CSS:
first
ensure your list has all the columns you'll need
second
here's how to create a custom "view" page (virtually the same steps can be followed for a custom "new" or custom "edit" page):
Open MS Office SharePoint Designer
File -> Open Site...
enter your web-site URL
Make sure the "Folder List" Task Pane is visible (Task Panes -> Folder List)
Expand the "Lists" folder
You should see entries like the following:
Announcements
Calendar
...
YOUR LIST NAME
...
Expand the entry with YOUR LIST NAME
You should see entries like the following
Attachments
Items
AllItems.aspx
DispForm.aspx
EditForm.aspx
NewForm.aspx
Right-Click on YOUR LIST NAME
Select New -> ASPX
Re-name the file to something meaningful, like: PrintForm.aspx
Open PrintForm.aspx
View in "Split" mode
In the Code pane, you should see your insert-point inside a blank html form
Insert -> SharePoint Controls -> Custom List Form...
Select YOUR LIST NAME from the first drop-down (List or document library to use for form)
Select "Item" from the second drop-down (Content type to use for form)
Select "Display item form (used to view list items)" (this is where you choose between view, new, edit)
Un-check "Show standard toolbar" when creating a printable form
Click OK
In the Design pane, you should see a basic table layout with labels on the left and values on the right
In the Code pane, you should see such code as the following for every Column in your list (this one's for a "Single line of text" column type):
<tr>
<td width="190px" valign="top" class="ms-formlabel">
<H3 class="ms-standardheader">
<nobr>Column name</nobr>
</H3>
</td>
<td width="400px" valign="top" class="ms-formbody">
<xsl:value-of select="#Column_x0020_name"/>
</td>
</tr>
You can now just take all those <xsl:value-of select="#Column_x0020_name"/> entries and do standard XHTML/CSS layout
To test, save your work
Then, in a web browser, navigate to your SharePoint web-site
Select an item you've already entered data for
Choose "View Item"
In the address bar, replace DispForm.aspx with PrintForm.aspx
some things to keep in mind:
spaces and punctuation characters make for annoying naming of Column name
Column name in the code will have a maximum length of 32 -- any names longer will be truncated, e.g.:
SharePoint Column name: this is a long name
becomes in the code: this_x0020_is_x0020_a_x0020_long
any Column name in the code that would be a duplicate will be length 32 plus a numeric suffix. so, given the above column also exists, we would then have e.g.:
SharePoint Column name: this is a long name also
becomes in the code: this_x0020_is_x0020_a_x0020_long0
if you add columns or modify columns, you'll have to add them in by hand to this page
(do the Insert -> SharePoint Controls -> Custom List Form... on another "dummy" page to get the naming right)
again, i couldn't have done this without #mortenbpost's answer!
*****You can now just take all those entries and do standard XHTML/CSS layout *****
can you expand this with an example on how to do it?
This isn't an answer so much as a note to the above.
Use a custom list form but keep in mind that if any of the columns have versioning turned on you will not be able to get at the "data" easily. For example if one of your colums is a Notes column and everytime someone edits the notes field a new version is appended then none of that is accessible as it's essentially a seperate "list." I'm stuck on this issue as I also have a client asking for a print out which "doesn't look like it's from SharePoint."
Alternatively, you could export to a spreadsheet & print from there.

Resources