SharePoint JS grid paging, capturing values using single click event
Hi
I need some help with getting the following work using the SharePoint JS grid, the reference articles available are not sufficient to continue work.
1) Setting up Paging
2) Capturing individual field values on single click or any other relevant event.
Sample code or references would be of great help.
References
http://msdn.microsoft.com/en-us/library/office/ee535898(v=office.14).aspx
http://answers.flyppdevportal.com/categories/sharepoint2010/sharepoint2010programming.aspx?ID=d6e32632-d0e4-4337-95c3-c2d06fc3ef86
http://answers.flyppdevportal.com/categories/sharepoint2010/sharepoint2010programming.aspx?ID=5c952c6d-b2be-4563-b805-b00e7c8136ff
http://msdn.microsoft.com/en-us/library/ff681039.aspx
http://social.msdn.microsoft.com/Forums/en-US/a439fcc2-42de-45ca-9f74-935498e0d246/js-grid-oncelleditcompleted-event-infinitely-fired?forum=project2010custprog
Thanks,
Sharat
Sharat Menon (Sharepoint Developer)
Hi,
Please try to use PagingFilter class to achieve paging in JS Grid.
http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.jsgrid.pagingfilter.aspx
Here is a similar thread for you to take a look at:
https://go4answers.webhost4life.com/Example/sharepoint-jsgrid-2692.aspx
If you want to implement more complex functionalities for a list, I suggest you use SPGridView to achieve it.
Best regards
Dennis Guo
TechNet Community Support
Similar Messages
-
Handle single click event in ALV OOPS
Hi,
I have to display 2 ALV grid...one above the other.
Top ALV will contain Header info and bottom ALV witll display line item.
I am use ALV OOPS.
Now when user will click on the top ALV ...bottom ALV should show corresponding data.
I don't have to use HOTSPOT or Double click event.
How can I handle single click event.
Please guide me..thanks in advance
Regards,
Prasoonhi,
for this in ALV OOPS take <b>2 custom containers( cl_gui_custom_container)</b>in the same screen and on the 1st container display the header data<b>(use set_tale_for_first_display method of class cl_gui_alv_grid)</b>.
On the 2nd screen item data for this use<b> EVENT</b> handling(you want <b>single click</b>). use<b> hotspot_click</b> or <b>button_click </b>events.
for this you have to register the events. the code for that.
<b>CLASS lcl_event_handler DEFINITION .</b>
PUBLIC SECTION .
METHODS:
*--Hotspot click control
handle_hotspot_click
FOR EVENT hotspot_click OF cl_gui_alv_grid
IMPORTING e_row_id e_column_id es_row_no ,
*--To control button clicks
handle_button_click
FOR EVENT button_click OF cl_gui_alv_grid
IMPORTING e_oject e_ucomm .
PRIVATE SECTION.
ENDCLASS.
<b>CLASS lcl_event_handlerIMPLEMENTATION .</b>
*--Handle Hotspot Click
METHOD handle_hotspot_click .
PERFORM handle_hotspot_click USING e_row_id e_column_id es_row_no .
ENDMETHOD .
METHOD handle_button_click .
PERFORM handle_button_click USING e_object e_ucomm .
ENDMETHOD .
ENDCLASS .
DATA gr_event_handler TYPE REF TO lcl_event_handler .
<b>*--Creating an instance for the event handler</b>
CREATE OBJECT gr_event_handler.
<b>*--Registering handler methods to handle ALV Grid events</b>
SET HANDLER gr_event_handler->handle_hotspot_click FOR gr_alvgrid .
SET HANDLER gr_event_handler->handle_button_click FOR gr_alvgrid .
do n't forget to use<b> refresh_table_display
</b> other wise only the record which you first you clicked will display in the 2nd container.
<b>Reward points for useful Answers</b> -
How to trigger single click event in ALV
Hi Experts,
I am trying to raise an event in a module pool program whereby an event will be triggered on a single click of a particular row in the ALV.
My requirement is that in the table display , which is being handled OO method, once the user clicks on a particular row - the details of the row should be displayed in another part of the screen.
I have used hotspots and done this - but I do not want all my entries underlined.Hi Atish,
Is there any other way to trigger the single click event in the ALV grid display for a particular row ? I have come across an event CLICK_ROW_COL, which I think may solve the problem, however this is a protected event and whenever I try to access it , I get the error that a protected event cannot be accessed.
Edited by: Aditya Niyogi on May 14, 2008 6:33 AM -
Print all slides in single click event
I have 10 quiz slides in captivate 5.5. Now my client wnats to print all the slides at the single click event. I have already used the Captivate inbuild Print widget, but its print the current slide only. Please help me on this.....
Thanks
KarthikThere is no current way to do this with standard Captivate functionality.
If this is really important to your client, you'll need to create a PDF document with screenshots of the 10 quiz slides, and link this document to a button within the course module. Participants can then click the button to open and print the document.
If anyone has a better idea, I'm open to it. -
Single click event in alv grid.
Hi Experts,
i have done will my code..everything is working perfectly, but having an issue..pls help me...
in my output screen i have 2 check-boxes,when i select both of them i shuld get a message saying select only one..this is done when am using double click. Is single click possible in alv-grid...
please help me.
thanks.
anushaHi Anusha,
Did you Try by using get_selected_rows(Method)?
If the selected rows are 2 display a message such that 'Select only One record'.
data t_roid type lvc_t_roid.
CALL METHOD r_grid->get_selected_rows
IMPORTING
et_row_no = t_roid.
READ TABLE t_roid INDEX 1 TRANSPORTING NO FIELDS."to know how many No.Of records selected
if sy-tfill > 1.
Message 'Please Select only one record' type 'I'.
Exit.
endif. -
L10: Using single click for extended desktop
Hi
I use a Sattelite L10 for presentations. Is there a way to set up the extended desktop with a single click (one! via .exe, .reg , .. file etc)? (A hot key would be nice too)
The problem is, if I start the computer without the external monitor / projector etc connected it reverts back to single display (normal desktop) and I have to Click right, browse to the correct option etc) I want a single button on my desktop / taskbar. (or hotkey)
Thanks
JPThanks for the replies.
But it obnly works until you shut down and restart without the external monitor attatched!
Thene you have to right click, properties, choose extended desktop etc again. -
Double click and single click Event
Hi
I want to add a Single Clcik event and Double click event both on the same movie clip in as3 , its working but call both the event same time so how to fix it , please help us if u have any solution ..(did you double click enable your object AND add a doubleclick listener? if so, what's the problem?
-
How to open a text file using button click event
hi, How can i open a text file in a textpad or notepad on the click event of a button.?
Thanks
JayPnt,
this will not work LV 8.0.1 and LV 8.6 will give back error 193.
Attached is a VI to use the ShellExecute WinAPI. The VI is LV 7.1.1.
Message Edited by waldemar.hersacher on 10-09-2008 10:48 PM
Waldemar
Using 7.1.1, 8.5.1, 8.6.1, 2009 on XP and RT
Don't forget to give Kudos to good answers and/or questions
Attachments:
ShellExecute.zip 27 KB -
Printing same Smartfom using single click on PRINT for many employee no.
Hi All,
This is my first question that i'm posting in the forum, hope u dont disappont me.
We made a smart form for HR-pay slip. It is working fine for one employee, but when a range of employees are selected it asks a print preview screen each time for every single employee. We managed to get rid of the pop up print preview screen but still on clicking PRINT, it prints first emp. smart form, then back (F3), and again print for second emp. HR people need to run this for hundreds of employee and cannot click print for each one of them.
So, all I wanted was that somehow on clicking PRINT the very first time it shall print for all the range of employees given.
Step.1.Get pernr.
Call SSFfunction module name for smartform ZHR_PAYSLIP
go back to (Step.1) picking the next pernr given while executionHi Vivek,
Thanks for your response, now i feel a member of the forum.
I am just a beginner in Smartforms.
Ur reply made me realise that i had not used SSF Open N SSF Close FM.
the fraction of the code is:
========================================
GET pernr.
CALL FUNCTION 'HR_READ_INFOTYPE'.
PERFORM process_pernr "VKIK032705
USING pernr-pernr pn-paper pn-permo payty payid bondt mc_incl
pnpabkrs[] subrc.
IF exp_frm EQ false.
CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
EXPORTING
formname = 'ZHR_PAYSLIP'IMPORTING
fm_name = formname
control-no_dialog = 'X'.
control-PREVIEW = 'X'.
output_options-tdnoprint = 'X'.
output_options-tdnoprev = 'X'.
output_options-tdimmed = 'X'.
output_options-tdiexit = 'X'.
CALL FUNCTION formname
EXPORTING
ARCHIVE_INDEX =
ARCHIVE_INDEX_TAB =
ARCHIVE_PARAMETERS =
CONTROL_PARAMETERS = control
NO_DIALOG =
MAIL_APPL_OBJ =
MAIL_RECIPIENT =
MAIL_SENDER =
OUTPUT_OPTIONS = output_options
'output_options added by himanshu 6.12.2006
USER_SETTINGS = ' '
v_amount = v_amount
IMPORTING
DOCUMENT_OUTPUT_INFO =
JOB_OUTPUT_INFO =
JOB_OUTPUT_OPTIONS =
ENDIF.
===========================================
so u see as i have embedded the Call SSF FM stmnt. it executes the smartform for one pernr (personnel no.) and when it fetches the next pernr in the stmnt. GET PERNR, it executes the smartform again.
Is there a way when the smartform can call itself so that the output is successive and i dont have to press back button each time to see the payslip of the next personnel no.
Also plz advise where shall I use the SSF_Open and SSF_Close FMs. -
Refresh alvgrid when using double click event
Hi all, I am displaying two grids on a single screen and the Grid2 will come to picture when i double click on the values in the Grid1 and will diplay corresponding values in Grid2 for GRID1. This is working fine for the first time and the values in Grid2 are not gettting refreshed for the second time i double click on the values in the Grid1.I am using method Grid2->refresh_table_display but this is giving me a dump. Please suggest me.
Thnaks in advance.Hi Phani,
Hope you get the dump because you are not catching the EXCEPTIONS after refresh_table_display.
CALL METHOD o_alvgrid->set_table_for_first_display
EXPORTING
is_layout = wa_layout
CHANGING
it_outtab = it_final[]
it_fieldcatalog = it_fieldcat.
CALL METHOD o_alvgrid->refresh_table_display
EXCEPTIONS
finished = 1
OTHERS = 2.
IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
Try to catch the EXCEPTION showing in the dump message.
TRY.
CATCH <exception>.
ENDTRY.
Hope your problem will solved...
Best Regards,
Sayak... -
Hi friends.........
Iam using flex tree control data coming from coldfusion file to display grid. As i click the tree folder to change the data from dynamic from grid.
How to pass the folder id from coldfusion file.. Is it possible ?.. Means give any example please....
Any One Help Me......
With Regards.,
Lingu.......When you set the dataProvider for your tree control, you actually pass an array or arraycollection or whatever to that property. The array contains objects coming from your server, right? Each object should contain a property with the folder id, something like:
var arr:Array = [{id: 1, folderID: 34, name: "..."}, {id: 2, folderID: 4, name: "..."}, ...];
Now, when you click an item in your tree or your dataGrid, you can access the folder id by:
myTree.selectedItem.folderID
Hope this helps
Dany -
How do you capture the export button click event?
<p>Hi, is this possible in VC++? Thanks.</p><p>Billy</p>
Hi Billy.
I would suggest asking this question in the VC++ forum as this forum is focused on the Design of the reports using Crystal Reports Designer.  Capturing events is a developer function and the way that Business Objects has split up these forums, it would make more sense and get the proper exposure there.
Kindest regards,Â
    - Kathryn Webster (Report Design Consultant)
          Kat's News: http://diamond.businessobjects.com/blog/279 -
Hi Experts,
I have an internal table and i display it using ALV. User will select some rows using checkboxes in the alv. Then i want to get a total based on selected rows. the totals will be display separate area. (Below the ALV)
Please help me to resolve above issue.
Regards,
Kosa.Hi Kosa,
Perhaps delayed_changed_sel_callback event should be helpful for u...
But u have to register it explicitly...
Check the below example..
* CLASS event_responder DEFINITION
CLASS lcl_event_responder DEFINITION.
PUBLIC SECTION.
METHODS : on_rows_selection FOR EVENT delayed_changed_sel_callback OF cl_gui_alv_grid.
ENDCLASS. "event_responder DEFINITION
TYPES : BEGIN OF ty_disp,
field1 TYPE i,
field2 TYPE i,
field3 TYPE i,
field4 TYPE i,
field5 TYPE i,
END OF ty_disp.
DATA : container TYPE REF TO cl_gui_custom_container,
popup TYPE REF TO cl_gui_dialogbox_container,
alv_grid TYPE REF TO cl_gui_alv_grid,
handler TYPE REF TO lcl_event_responder,
ls_layo TYPE lvc_s_layo,
lt_rows TYPE TABLE OF lvc_s_row WITH HEADER LINE,
lt_disp TYPE TABLE OF ty_disp WITH HEADER LINE,
lt_fldcat TYPE TABLE OF lvc_s_fcat WITH HEADER LINE,
lt_event TYPE cntl_simple_events WITH HEADER LINE.
START-OF-SELECTION.
CALL SCREEN 100.
* MODULE PBO OUTPUT *
MODULE pbo OUTPUT.
SET PF-STATUS 'BASIC'.
CHECK container IS NOT BOUND.
CREATE OBJECT container
EXPORTING
container_name = 'CUSTOM'.
CREATE OBJECT alv_grid
EXPORTING
i_parent = container.
PERFORM field_catalog.
PERFORM fill_outtab.
ls_layo-sel_mode = 'A'.
alv_grid->set_table_for_first_display( EXPORTING is_layout = ls_layo
CHANGING it_outtab = lt_disp[]
it_fieldcatalog = lt_fldcat[] ).
alv_grid->register_delayed_event( i_event_id = cl_gui_alv_grid=>mc_evt_delayed_change_select ).
CREATE OBJECT handler.
SET HANDLER : handler->on_rows_selection FOR alv_grid.
ENDMODULE. "pbo OUTPUT
* MODULE PAI INPUT *
MODULE pai INPUT.
LEAVE PROGRAM.
ENDMODULE. "pai INPUT
FORM field_catalog.
lt_fldcat-fieldname = 'FIELD1'.
lt_fldcat-reptext = 'One'.
APPEND lt_fldcat .
lt_fldcat-fieldname = 'FIELD2'.
lt_fldcat-reptext = 'Two'.
APPEND lt_fldcat .
lt_fldcat-fieldname = 'FIELD3'.
lt_fldcat-reptext = 'Three'.
APPEND lt_fldcat .
lt_fldcat-fieldname = 'FIELD4'.
lt_fldcat-reptext = 'Four'.
APPEND lt_fldcat .
lt_fldcat-fieldname = 'FIELD5'.
lt_fldcat-reptext = 'Five'.
APPEND lt_fldcat .
ENDFORM. "field_catalog
FORM fill_outtab.
FREE lt_disp.
DO 20 TIMES.
lt_disp-field1 = sy-index * 1.
lt_disp-field2 = sy-index * 2.
lt_disp-field3 = sy-index * 3.
lt_disp-field4 = sy-index * 4.
lt_disp-field5 = sy-index * 5.
APPEND lt_disp.
ENDDO.
ENDFORM. "fill_outtab
FORM do_sum.
alv_grid->get_selected_rows( IMPORTING et_index_rows = lt_rows[] ).
BREAK-POINT. " lt_rows[] has the indices of selected rows..
ENDFORM. "do_sum
* CLASS event_responder IMPLEMENTATION *
CLASS lcl_event_responder IMPLEMENTATION.
METHOD on_rows_selection.
PERFORM do_sum.
ENDMETHOD. "on_rows_selection
ENDCLASS. "event_responder IMPLEMENTATION
Cheers,
Jose. -
Want to trigger at selection screen on 'X' using mouse click event.
I've designed a report which has two radiobuttons i would to like change the selection screen depends on the selection of the button as of now i'm selecting the button and hitting enter so that at selection screen on radiobutton group triggers.but for more user friendly I would like trigger as soon as i click on the button. Is it possible to do this?
cheers
AnandHi,
all the selection screen elements which u want to be appearing on the screen during one radio button should be declared as:
SELECTION-SCREEN BEGIN OF BLOCK b_2 WITH FRAME TITLE text-001.
*PARAMETERS: rb_img RADIOBUTTON GROUP rad1.
PARAMETERS: p_from like bkpf-bldat modif id gr2,
p_to like bkpf-bldat modif id gr2.
SELECT-OPTIONS: s_arobj FOR toa01-ar_object modif id gr2.
SELECTION-SCREEN END OF BLOCK b_2.
SELECTION-SCREEN BEGIN OF BLOCK b_3 WITH FRAME TITLE text-001.
*PARAMETERS: rb_invo RADIOBUTTON GROUP rad1.
SELECT-OPTIONS: s_bukrs FOR bkpf-bukrs modif id gr1,
s_belnr FOR bkpf-belnr modif id gr1,
s_gjahr FOR bkpf-gjahr modif id gr1,
SELECTION-SCREEN END OF BLOCK b_3.
AT SELECTION SCREEN
AT SELECTION-SCREEN OUTPUT.
LOOP AT SCREEN.
IF SCREEN-GROUP1 = 'GR1'.
IF RB_INVO = SPACE.
SCREEN-ACTIVE = 0.
ELSE.
SCREEN-ACTIVE = 1.
ENDIF.
MODIFY SCREEN.
ELSEIF SCREEN-GROUP1 = 'GR2'.
IF RB_INVO = C_X.
SCREEN-ACTIVE = 0.
ELSE.
SCREEN-ACTIVE = 1.
ENDIF.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
Hope this helps you.
Regards,
Anjali -
Sharepoint 2010 Custom Visual Webpart button click event firing on page refresh
I have developed a Visual Webpart to create a list in SP using vs2010 and the button click event I have written the list create method. If I click the button list is created successfully. And I refresh the page again list is creating(Again button
click event is triggering).please help me to solve the issue.
protected void Button1_Click(object sender,
EventArgs e)
SPWeb web
= SPContext.Current.Web;
//SPList list=web.Lists["Auto"];
SPList list
= web.Lists[DropDownList2.SelectedItem.Text];
if
(string.IsNullOrEmpty(TextBox1.Text)
|| string.IsNullOrEmpty(DropDownList1.Text))
Label4.Text =
"Fields Are Empty";
else
if (DropDownList1.SelectedItem.Text
== "Single line of Text")
list.Fields.Add(TextBox1.Text,
SPFieldType.Text,
true);
SPView viewname = list.Views["All Items"];
viewname.ViewFields.Add(TextBox1.Text);
//viewname.Update();
list.Update();
Label4.Text =
"Field Created Successfully";
TextBox1.Text =
string.Empty;
// Label4.Text = string.Empty;Hi,
This is because the request is sent to the server when you refresh the page.
A workaround for this is that we can “provide a refresh link that redirects to the same page (or if you have some action causing the refresh programmatically, you could just
redirect to the page after that, with Response.Redirect)
so that page is requested by the browser (with GET method, default with hyperlinks)”.
More information:
http://social.msdn.microsoft.com/Forums/sharepoint/en-US/45648b39-1229-405c-ac9e-60eb82905982/click-event-getting-fired-on-page-refresh
Or we can use the Session to save a value which used as a flag for us to check whether it is a page refresh and perform accordingly.
http://www.codeproject.com/Articles/28099/Refresh-Page-Issue-in-ASP-Net
http://www.codeproject.com/Articles/10240/Detecting-Page-Refresh
Thanks
Patrick Liang
TechNet Community Support
Maybe you are looking for
-
I bought the photoshop install online and I put it on my laptop. But now I have a new and better computer for photo and video but I can not figure out how to reinstall my photoshop on this new computer. When I bought it, they said I would be able to
-
Facebook Like button doesn't work in website mobile version made in adobe muse
the Facebook LIke button doesn't work on the mobile web version mde with adobe muse.....in the desktop version it works perfectly bbut in a tablet or smartphone it doesn't work you should fix that
-
Apex v4.1 MSIE v8.0 and Windows XP Firefox v6.0.2 Background Sorry it's a lot but I figure giving all this context would help avoid tangental questions that could derail from my real question(s). I have a master-detail page where I have such business
-
Programatically knowing mode of Form
Hi, How can I programatically find out whether my form is running in Query only mode in Forms 5.0 / 6.0 ? Thanx in advance. --- Ravi null
-
Parameter memory not initializing whwn re execute the program
I have used parameter memory in selection screen of module pool program, The problem is when I exit from the program and re execute the transaction the parameter memory not initializing and the same value come again in the selection screen .