How To Add menu when rightclick on dynamic grid in ext.net? - c#-4.0

How To Add menu when rightclick on dynamic grid in ext.net ?
I Had Tried As Below In RowExpander, It is Showing That ItemContextMenu does not support in RowExpander, Please Help me ?
<ext:RowExpander runat="server">
<Loader runat="server" DirectMethod="#{DirectMethods}.GetGrid" Mode="Component">
<LoadMask ShowMask="true" />
<Params>
<ext:Parameter Name="RecordId" Value="this.record.getId()" Mode="Raw" />
</Params>
</Loader>
<DirectEvents>
<BeforeExpand OnEvent="BeforeExpand" Success="setRaw(response, result, el, type, action, extraParams);" Before="return !record.cached;">
<EventMask ShowMask="true" Target="CustomTarget" CustomTarget="={gridRecords.body}" />
<ExtraParams>
<%--<ext:Parameter Name="company" Value="record.data['company']" Mode="Raw" />
<ext:Parameter Name="id" Value="record.id" Mode="Raw" />
<ext:Parameter Name="index" Value="rowIndex" Mode="Raw" /> --%>
<ext:Parameter Name="RecordId" Value="record.get('RecordId')" Mode="Raw" />
</ExtraParams>
</BeforeExpand>
</DirectEvents>
<Listeners>
<ItemContextMenu Handler="e.preventDefault(); #{mnuView}.showAt(e.getXY());" />
</Listeners>
</ext:RowExpander>

RowExpander doesn't have an ItemContextMenu event. You should define it for a child GridPanel itself.
It is being discussed in greater details in these forum threads:
Forum thread #1
Forum thread #2

Related

Acumatica - Grid in PXTabItem on PXSmartPanel Not Appearing on Screen

I have a PXSmartPanel on the Sales Orders form (SO301000) in Acumatica ERP (v21.109.0018). In the PXSmartPanel I have a PXTab with two PXTabItem's. Each tab item has a PXGrid in it.
Whenever the smart panel opens, the grid in the first tab item shows with the correct data. But when I select the other tab item, the grid doesn't show at all (no data, no column names, no toolbar actions). I'm not sure if there's an attribute that I'm missing, but any help would be appreciated.
Here is my ASPX code for the PXSmartPanel. The grid with the ID "GridKitNonStkComponents" is the one that isn't showing:
<px:PXSmartPanel runat="server" ID="KitComponentsPanel" DesignView="Content" AllowResize="true"
AcceptButtonID="KitComponentSaveButton" CancelButtonID="KitComponentCancelButton" LoadOnDemand="true"
CaptionVisible="true" Caption="Kit Component Items" Key="KitComponentsPanel"
AutoRepaint="true" style="position:static;" Height="400px" Width="560px">
<px:PXTab ID="kitCompTab" runat="server" Width="100%" Height="85%">
<Items>
<px:PXTabItem Text="Stock Components">
<Template>
<px:PXGrid runat="server" ID="GridKitStkComponents" Height="100%" Width="100%" SyncPosition="true">
<Levels>
<px:PXGridLevel DataMember="KitStkComponents">
<Columns>
<px:PXGridColumn DataField="CompInventoryID" Width="70" CommitChanges="True" />
<px:PXGridColumn DataField="CompDescription" Width="280" />
<px:PXGridColumn DataField="ComponentQty" />
</Columns>
</px:PXGridLevel>
</Levels>
<ActionBar Position="Top">
<Actions>
<AddNew MenuVisible="True" />
<Save MenuVisible="False" Enabled="False" />
<Search MenuVisible="False" Enabled="False" />
<NoteShow Enabled="False" MenuVisible="False" />
<Refresh MenuVisible="True" />
<Delete MenuVisible="True" />
<AdjustColumns MenuVisible="True" />
<ExportExcel MenuVisible="True" />
</Actions>
<CustomItems>
<px:PXToolBarButton>
<AutoCallBack Command="ResetStkCompsToDefault" Target="ds">
<Behavior CommitChanges="true" />
</AutoCallBack>
</px:PXToolBarButton>
</CustomItems>
</ActionBar>
<AutoSize Enabled="true" />
</px:PXGrid>
</Template>
</px:PXTabItem>
<px:PXTabItem Text="Non-Stock Components" LoadOnDemand="true">
<Template>
<px:PXGrid runat="server" ID="GridKitNonStkComponents" Height="100%" Width="100%" SyncPosition="true">
<Levels>
<px:PXGridLevel DataMember="KitNonStkComponents">
<Columns>
<px:PXGridColumn DataField="CompInventoryID" Width="70" CommitChanges="True" />
<px:PXGridColumn DataField="CompDescription" Width="280" />
<px:PXGridColumn DataField="ComponentQty" />
</Columns>
</px:PXGridLevel>
</Levels>
<ActionBar Position="Top">
<Actions>
<AddNew MenuVisible="True" />
<Save MenuVisible="False" Enabled="False" />
<Search MenuVisible="False" Enabled="False" />
<NoteShow Enabled="False" MenuVisible="False" />
<Refresh MenuVisible="True" />
<Delete MenuVisible="True" />
<AdjustColumns MenuVisible="True" />
<ExportExcel MenuVisible="True" />
</Actions>
<CustomItems>
<px:PXToolBarButton>
<AutoCallBack Command="ResetNonStkCompsToDefault" Target="ds">
<Behavior CommitChanges="true" />
</AutoCallBack>
</px:PXToolBarButton>
</CustomItems>
</ActionBar>
<AutoSize Enabled="true" />
</px:PXGrid>
</Template>
</px:PXTabItem>
</Items>
</px:PXTab>
<px:PXPanel ID="KitComponentButtonPanel" runat="server" SkinID="Buttons">
<px:PXButton ID="KitComponentSaveButton" runat="server" DialogResult="OK" Text="Save" />
<px:PXButton ID="KitComponentCancelButton" runat="server" DialogResult="Cancel" Text="Cancel" />
</px:PXPanel>
</px:PXSmartPanel>
Here is the code for my graph extension (at the moment, the EditKitComponents action just opens the smart panel):
public class SOOrderEntry_Extension : PXGraphExtension<SOOrderEntry>
{
public static bool IsActive() => true;
#region Selects / Views
public SelectFrom<SOLineKitComponent>.
Where<SOLineKitComponent.soOrderType.IsEqual<SOLine.orderType.FromCurrent>.
And<SOLineKitComponent.soOrderNbr.IsEqual<SOLine.orderNbr.FromCurrent>>.
And<SOLineKitComponent.soLineNbr.IsEqual<SOLine.lineNbr.FromCurrent>>.
And<SOLineKitComponent.kitInventoryID.IsEqual<SOLine.inventoryID.FromCurrent>>.
And<SOLineKitComponent.stkItem.IsEqual<True>>>.View KitStkComponents;
public SelectFrom<SOLineKitComponent>.
Where<SOLineKitComponent.soOrderType.IsEqual<SOLine.orderType.FromCurrent>.
And<SOLineKitComponent.soOrderNbr.IsEqual<SOLine.orderNbr.FromCurrent>>.
And<SOLineKitComponent.soLineNbr.IsEqual<SOLine.lineNbr.FromCurrent>>.
And<SOLineKitComponent.kitInventoryID.IsEqual<SOLine.inventoryID.FromCurrent>>.
And<SOLineKitComponent.stkItem.IsEqual<False>>>.View KitNonStkComponents;
public SelectFrom<SOOrder>.View KitComponentsPanel;
#endregion
#region Actions
public PXAction<SOOrder> EditKitComponents;
[PXButton]
[PXUIField(DisplayName = "Edit Kit Components")]
public virtual void editKitComponents()
{
if(KitComponentsPanel.AskExt() == WebDialogResult.OK)
{
}
}
#endregion
}
Here is what the smart panel looks like when the different tab items are selected:
Tab Item with Grid Showing
Tab Item with Grid Not Showing
You need to set the "LoadOnDemand" to false for the whole PXSmartPanel to have the second tab working.
<px:PXSmartPanel runat="server" ID="KitComponentsPanel"
...
LoadOnDemand="False"
...
>
I would also consider setting LoadOnDemand to false for the second tab.
<px:PXTabItem Text="Non-Stock Components" LoadOnDemand="false">

Callback when Ext.NET Combobox local query returns no data

Using Ext.NET combobox.
<ext:ComboBox runat="server"
ID="ComboBoxCategorizedList"
QueryMode="Local"
ValueField="Id"
EmptyText="Type to begin search..."
TypeAhead="false"
DisplayField="Name"
Width="500"
NoteAlign="Down" EnableKeyEvents="true"
Note="Press 'Search' icon or Press ENTER for more results"
RemoveClearTrigger="true">
<%--Note="Type '*' for a full list"--%>
<HtmlBin>
<ext:XScript runat="server">
<script type="text/javascript">
$(window).on("__refresh__", function () {
#{ StoreComboBoxCategorizedList }.reload();
});
</script>
</ext:XScript>
</HtmlBin>
<Store>
<ext:Store runat="server" ID="StoreComboBoxCategorizedList" OnReadData="ComboBoxCategorizedList_ReadData">
<Proxy>
<ext:PageProxy />
</Proxy>
<Model>
<ext:Model Id="ModelCategorizedComboBox" runat="server" IDProperty="Id">
<Fields>
<ext:ModelField Name="Id" />
<ext:ModelField Name="Name" />
<ext:ModelField Name="Type" />
<ext:ModelField Name="RefId" />
<ext:ModelField Name="Description" />
</Fields>
</ext:Model>
</Model>
<Listeners>
<Update Handler="#{ComboBoxCategorizedList}.expand();" />
<EndUpdate Handler="categorizedList();" />
</Listeners>
<Parameters>
<ext:StoreParameter Mode="Raw" Name="filter" Value="#{ComboBoxCategorizedList}.getValue()" />
</Parameters>
</ext:Store>
</Store>
<Triggers>
<ext:FieldTrigger Icon="Clear"/>
<ext:FieldTrigger Icon="Search"></ext:FieldTrigger>
</Triggers>
<Listeners>
<SpecialKey Fn="enterKeyPressHandler" />
<Expand Handler="categorizedList();" Delay="100" />
<BeforeSelect Fn="onBeforeSelect" />
<KeyPress Handler="#{ComboBoxCategorizedList}.getTrigger(1).onClick();" Buffer="1000" />
<Change Handler="filterComboxBoxFunction(#{StoreComboBoxCategorizedList}, #{ComboBoxCategorizedList}.getValue()); #{ComboBoxCategorizedList}.expand(); categorizedList();" Delay="100" />
</Listeners>
Not asking for debugging help, but I want to know if an Ext.NET or Extjs dev has a generic solution: Very simply ... I want to initiate a remote search only when the local search returns no records. So I am looking for the best way to wire this up to the combobox. I've looked at using the Expand event and BeforeQuery event but this seems to come up short.
I'm looking for best practices so i can add a "OnLocalQuery" event to my comboboxes; and then take action if the local query returns 0 matches.
I use this function and it works fine .. and without QueryMode="Local":
<ext:ComboBox ID="cmb_name" runat="server" FieldLabel="ComboBox" EmptyText="-Select-" HideTrigger="true" TriggerAction="All" SelectOnFocus="true" DisplayField="Name" ValueField="Id" Editable="true" TabIndex="11">
<Store>
<ext:Store ID="str_ComboBox" runat="server" PageSize="10">
<Model>
<ext:Model ID="mdl_ComboBox" runat="server">
<Fields>
<ext:ModelField Name="Id" />
<ext:ModelField Name="Name" />
<ext:ModelField Name="Type" />
<ext:ModelField Name="RefId" />
<ext:ModelField Name="Description" />
</Fields>
</ext:Model>
</Model>
</ext:Store>
</Store>
<Listeners>
<Change Fn="fn_filter" />
</Listeners>
</ext:ComboBox>
<script type="text/javascript">
var fn_filter = function (_this, newValue, oldValue, eOpts) {
var n = 0;
if (_this.lastQuery == undefined || _this.lastQuery == null) {
_this.lastQuery = "";
}
_this.getStore().clearFilter(true);
_this.getStore().load();
_this.store.filter(function (item) {
if (item.get('Name').includes(_this.getRawValue())) {
n = n + 1;
return true;
}
else {
return false;
}
});
_this.expand();
if (n == 0) {
//returns no records
//enter code here Callback
}
}
</script>

DocuSign API - Creating an envelope with a Document that has an Approve button

I am creating a draft envelope with a TXT document - which needs to display an Approve button to allow the signer to sign without placing a signature/initials on the document itself. Unfortunately I can't get the Approve button to show on the document, where have I gone wrong?
Here is the Request XML:
<ns1:envelopeDefinition xmlns:ns1="http://www.docusign.com/restapi">
<ns1:emailSubject>Test from iPaaS</ns1:emailSubject>
<ns1:documents>
<ns1:document>
<ns1:name>TestDocument</ns1:name>
<ns1:documentId>1</ns1:documentId>
<ns1:documentBase64><Base64BytesHere></ns1:documentBase64>
<ns1:fileExtension>txt</ns1:fileExtension>
</ns1:document>
</ns1:documents>
<ns1:recipients>
<ns1:signers>
<ns1:signer>
<ns1:routingOrder>1</ns1:routingOrder>
<ns1:recipientId>1</ns1:recipientId>
<ns1:name>John Smith</ns1:name>
<ns1:email>nobody#nobody.com</ns1:email>
</ns1:signer>
</ns1:signers>
</ns1:recipients>
<ns1:tabs>
<ns1:approveTabs>
<ns1:approve>
<anchorCaseSensitive />
<anchorHorizontalAlignment />
<anchorIgnoreIfNotPresent />
<anchorMatchWholeWord />
<anchorString />
<anchorUnits />
<anchorXOffset />
<anchorYOffset />
<conditionalParentLabel />
<conditionalParentValue />
<customTabId />
<documentId>1</documentId>
<mergeField />
<pageNumber>1</pageNumber>
<recipientId>1</recipientId>
<tabId />
<tabOrder />
<templateLocked />
<templateRequired />
<xPosition>100</xPosition>
<yPosition>100</yPosition>
<bold />
<font />
<fontColor />
<fontSize />
<italic />
<tabLabel />
<underline />
<buttonText />
<height>30</height>
<width>50</width>
</ns1:approve>
</ns1:approveTabs>
</ns1:tabs>
</ns1:envelopeDefinition>
Essentially I am looking for something that looks like the attached screenshot
The <tabs> node should be inside the <signer> node. The following example should work.
<ns1:envelopeDefinition xmlns:ns1="http://www.docusign.com/restapi">
<ns1:emailSubject>Test from iPaaS</ns1:emailSubject>
<ns1:documents>
<ns1:document>
<ns1:name>TestDocument</ns1:name>
<ns1:documentId>1</ns1:documentId>
<ns1:fileExtension>txt</ns1:fileExtension>
<ns1:documentBase64>RG9jIFRXTyBUV08gVFdP</ns1:documentBase64>
<ns1:fileExtension>txt</ns1:fileExtension>
</ns1:document>
</ns1:documents>
<ns1:recipients>
<ns1:signers>
<ns1:signer>
<ns1:routingOrder>1</ns1:routingOrder>
<ns1:recipientId>1</ns1:recipientId>
<ns1:name>John Smith</ns1:name>
<ns1:email>johnsmith#acme.com</ns1:email>
<ns1:tabs>
<ns1:approveTabs>
<ns1:approve>
<documentId>1</documentId>
<pageNumber>1</pageNumber>
<xPosition>100</xPosition>
<yPosition>100</yPosition>
<height>30</height>
<width>50</width>
</ns1:approve>
</ns1:approveTabs>
</ns1:tabs>
</ns1:signer>
</ns1:signers>
</ns1:recipients>
</ns1:envelopeDefinition>

Ext Net TimeField in an editable grid

I have a grid panel which display two TimeSpans in two columns and all is well when I load the page but when I go server side the validation on my editors always fail. I don't understand why the store can display the TimeSpans but cannot return it after...
Here my code :
<ext:GridPanel ID="WeekParams" runat="server" >
<Store>
<ext:Store runat="server">
<Reader>
<ext:JsonReader IDProperty="GUID">
<Fields>
<ext:RecordField Name="Day" Type="String" />
<ext:RecordField Name="UATNumber" Type="int" />
<ext:RecordField Name="From" Type="Date" />
<ext:RecordField Name="To" Type="Date" />
</Fields>
</ext:JsonReader>
</Reader>
</ext:Store>
</Store>
<ColumnModel>
<Columns>
<ext:Column ColumnID="Day" DataIndex="Day" />
<ext:NumberColumn ColumnID="UATNumber" DataIndex="UATNumber" Format="0" />
<ext:DateColumn ColumnID="From" DataIndex="From" Format="dd/MM/yyyy" >
<Renderer Format="Date" FormatArgs="'HH:mm'" />
<Editor>
<ext:TimeField runat="server" />
</Editor>
</ext:DateColumn>
<ext:DateColumn ColumnID="To" DataIndex="To" Format="dd/MM/yyyy" >
<Renderer Format="Date" FormatArgs="'HH:mm'" />
<Editor>
<ext:TimeField runat="server" />
</Editor>
</ext:DateColumn>
</Columns>
</ColumnModel>
<Plugins>
<ext:EditableGrid runat="server" />
</Plugins>
</ext:GridPanel>
And here the result when I'm going to the server side :

crm 2011 ribbon: disable system button

I have a problem with disabling ribbon button via javascript custom rule.
The action for that I want to add "enable rule" is called Mscrm.AddExistingRecordFromSubGridAssociated -> which is displayed when subgrid gets focus.
I use the ribbon workbench solution and I almost sure I did everything fine, but it doesn't work.
javascript:
utils.ribbon.isAddExistingDisabled = function(grid) {
return false; //just for test I wrote always false, but it's enabled anyway :/
}
CommandDef:
<CommandDefinition Id="Mscrm.AddExistingRecordFromSubGridAssociated">
<EnableRules>
<EnableRule Id="Mscrm.AppendToPrimary" />
<EnableRule Id="Mscrm.EntityFormIsEnabled" />
<EnableRule Id="my.incident.addMainCause.EnableRule" />
</EnableRules>
<DisplayRules>
<DisplayRule Id="Mscrm.AddExisting" />
<DisplayRule Id="Mscrm.ShowForManyToManyGrids" />
<DisplayRule Id="Mscrm.AppendToPrimary" />
<DisplayRule Id="Mscrm.AppendSelected" />
</DisplayRules>
<Actions>
<JavaScriptFunction FunctionName="Mscrm.GridRibbonActions.addExistingFromSubGridAssociated" Library="/_static/_common/scripts/RibbonActions.js">
<CrmParameter Value="SelectedEntityTypeCode" />
<CrmParameter Value="SelectedControl" />
</JavaScriptFunction>
</Actions>
</CommandDefinition>
Enable rule def:
<EnableRule Id="my.incident.addMainCause.EnableRule">
<CustomRule FunctionName="utils.ribbon.isAddExistingDisabled" Library="$webresource:my_js/incident/common.js" InvertResult="false">
<CrmParameter Value="SelectedControl" />
</CustomRule>
</EnableRule>

Resources