You need to sign in to do that
Don't have an account?
deepak kumar 13
Pagination Inline Edit using datatable in VF Page
Hi,
In my VF page i am using pagination using data tables. Datatable is working fine in pageblock table. And also i need to implement inline edit option in the datatable. When i edit any column using inline editor its working fine in 1st page. When i move to second page and next pages, inline edit option is not working. Please help to fix the code.
/* Datatable code */
j$ = jQuery.noConflict();
var editor;
j$(document).ready( function () {
var Searchtable1 = j$('[id$="Table1"]').DataTable({
})
/* VF Page block table */
<apex:pageblock id="pgblk3" rendered="{!EditAll}" title="Edit All Line items">
<apex:pageblockbuttons >
<apex:commandbutton value="Save" action="{!SaveEditItems}" id="savebutton"/>
<apex:commandbutton value="Cancel" action="{!cancelbton}" id="cancelbutton"/>
</apex:pageblockbuttons>
<apex:pageblocktable title="Edit Study Country Budget Items" value="{!EditAllItems}" var="scl" id="Table1">
<apex:column headerValue="Budget Item Id">
<apex:outputfield value="{!scl.Name}"/>
</apex:column>
<apex:column headerValue="Description">
<apex:actionregion >
<apex:outputfield value="{!scl.Description__c}">
<apex:inlineEditSupport event="ondblClick" showOnEdit="savebutton,cancelbutton" />
</apex:outputfield>
</apex:actionregion>
</apex:column>
<apex:column headerValue="Budget Library">
<apex:actionregion >
<apex:outputfield value="{!scl.Budget_Library__c}">
<apex:inlineEditSupport event="ondblClick" showOnEdit="savebutton,cancelbutton" />
</apex:outputfield>
</apex:actionregion>
</apex:column>
<apex:column headerValue="Estimated Cost Max">
<apex:actionregion >
<apex:outputfield value="{!scl.Estimated_Cost_Max__c}">
<apex:inlineEditSupport event="ondblClick" showOnEdit="savebutton,cancelbutton" />
</apex:outputfield>
</apex:actionregion>
</apex:column>
<apex:column headerValue="Estimated Cost Min">
<apex:actionregion >
<apex:outputfield value="{!scl.Estimated_Cost_Min__c}">
<apex:inlineEditSupport event="ondblClick" showOnEdit="savebutton,cancelbutton" />
</apex:outputfield>
</apex:actionregion>
</apex:column>
</apex:pageblocktable>
</apex:pageblock>
In my VF page i am using pagination using data tables. Datatable is working fine in pageblock table. And also i need to implement inline edit option in the datatable. When i edit any column using inline editor its working fine in 1st page. When i move to second page and next pages, inline edit option is not working. Please help to fix the code.
/* Datatable code */
j$ = jQuery.noConflict();
var editor;
j$(document).ready( function () {
var Searchtable1 = j$('[id$="Table1"]').DataTable({
})
/* VF Page block table */
<apex:pageblock id="pgblk3" rendered="{!EditAll}" title="Edit All Line items">
<apex:pageblockbuttons >
<apex:commandbutton value="Save" action="{!SaveEditItems}" id="savebutton"/>
<apex:commandbutton value="Cancel" action="{!cancelbton}" id="cancelbutton"/>
</apex:pageblockbuttons>
<apex:pageblocktable title="Edit Study Country Budget Items" value="{!EditAllItems}" var="scl" id="Table1">
<apex:column headerValue="Budget Item Id">
<apex:outputfield value="{!scl.Name}"/>
</apex:column>
<apex:column headerValue="Description">
<apex:actionregion >
<apex:outputfield value="{!scl.Description__c}">
<apex:inlineEditSupport event="ondblClick" showOnEdit="savebutton,cancelbutton" />
</apex:outputfield>
</apex:actionregion>
</apex:column>
<apex:column headerValue="Budget Library">
<apex:actionregion >
<apex:outputfield value="{!scl.Budget_Library__c}">
<apex:inlineEditSupport event="ondblClick" showOnEdit="savebutton,cancelbutton" />
</apex:outputfield>
</apex:actionregion>
</apex:column>
<apex:column headerValue="Estimated Cost Max">
<apex:actionregion >
<apex:outputfield value="{!scl.Estimated_Cost_Max__c}">
<apex:inlineEditSupport event="ondblClick" showOnEdit="savebutton,cancelbutton" />
</apex:outputfield>
</apex:actionregion>
</apex:column>
<apex:column headerValue="Estimated Cost Min">
<apex:actionregion >
<apex:outputfield value="{!scl.Estimated_Cost_Min__c}">
<apex:inlineEditSupport event="ondblClick" showOnEdit="savebutton,cancelbutton" />
</apex:outputfield>
</apex:actionregion>
</apex:column>
</apex:pageblocktable>
</apex:pageblock>
May I Request you Please refer the below link for reference.
https://developer.salesforce.com/forums/?id=906F000000091vZIAQ
http://sfdcsrini.blogspot.com/2014/08/inline-editing-in-visualforce-page.html
Best Regards
Rahul Kumar