iSeller Commerce
iSeller POS Retail
iSeller POS F&B
iSeller POS Express
Crosslight
WebUI
ClientUI
What's New
Download Trial
Web Solution
Mobile Solution
Enterprise Solution
Custom Development
Blog
Community
Latest Development Blogs
ForumPostTopic
Browse By Tag
I had disabled some items in the webcombo ,and disabled items are selected in webcombo.Now i am try to remove the selected items using delete/backspace key.Here i want to control the removal of selected disabled items,which should not be removed.
Hello,Thank you for the question regarding WebCombo.If you don’t mind, could you provide me more information regarding your scenario?So you don’t want to the selected disabled item can’t be deleted from WebCombo, even you use backspace to delete the item?Could you provide me your current WebCombo as well?Please forgive me for lack of understanding about the reported problem.Regards,Hans K.
Hello Kristian,
Thanks for your response.Please find the below details regarding the query.
Initially I had selected some items in core Process webcombo ,Based on the certain condition i am going to disable the some of the selected items in core Process webcombo using the below code.
var WCSubProcess = ISGetObject("WCSubProcess");
var result = Transactions_TestPage.GetTestCaseRequirementMap(TestCaseID);//Retrive Data Set from Data Base.
for (var RM = 0; RM < result.value.Tables[0].Rows.length; RM++)
{ bol = false; for (var CP = 0; CP < WCCoreProcess.GetRows().length; CP++)
{ if (WCCoreProcess.GetRows()[CP].Value == result.value.Tables[0].Rows[RM].TCP_CoreProcessID)
//If CoreProcess id match with combo item then we disable the combo item
{ WCCoreProcess.GetRows()[CP].RowElement.disabled = true; bol = true; } }
}
After disabling the selected item now the user going to remove the selected item,here i need to control the delete process as per below conditions,
1) I should not allow the deletion of the disabled selected items
2) But user can able to delete the non disabled selected items.
I am using Intersoft wecombo 4.0. Below is my Webcombo control.
<ISWebCombo:WebCombo ID="WebCombo1" runat="server" UseDefaultStyle="True" Width="310px" DataTextField="CoreProcessName" DataValueField="CoreProcessID" Height="200px"> <Columns> <ISWebCombo:WebComboColumn BaseFieldName="CoreProcessName" Bound="False" HeaderText="Core Process Name" Name="ProcessName" Width="310px" /> </Columns> <MultipleSelectionSettings Enabled="True" AllowBrowseAll="true" AutoPositionResultBox="false" AutoSelectFirstMatch="true" AllowNotInListText="true" /> <LayoutSettings ComboMode="SingleColumn" SearchImage="./images/Search.jpg" TextBoxMode="Editable" AlwaysShowHelpButton="false"> <ClientSideEvents OnValueItemNotInList="Combo_OnValueItemNotInList" /> </LayoutSettings></ISWebCombo:WebCombo>
Code to bind the Control:
var combo = ISGetObject(cntrlName);
var rows = combo.GetRows();
//res Has Data Set Retrived from Data Base Using Ajax Method.
if (res.value != null && rows <= 0)
{ var Tbl = res.value.Tables[0];
for (i = 0; i < Tbl.Rows.length; i++)
{ newRow = combo.NewRow("CoreProcess"); newRow.Value = Tbl.Rows[i].CoreProcessID; newRow.Text = Tbl.Rows[i].CoreProcessName; newRow.SetChanged(); rows.Add(newRow); }
combo.UpdateUI();
I am using Keydown event as below to identify the del or backspace key press but i cant able to get the current item which going to be deleted.Please provide the suggestion to meet my requirement.
function WebCombo1_OnInitialize(controlId) { var WebCombo1 = ISGetObject(controlId); var comboText = document.getElementById(controlId + "_text"); Listener.Add(comboText, "onkeydown", WCCoreProcessOnKeyDown); return true; }
Hai Hans ,
Thanks for your response.
your solution is fine, but our client required to type text in webcombo text field inorder to search and add the webcombo items.
They will use large no. of items, so they feel search and add the items is easier then selecting the checkbox by scrolling among the large no.of items in webcombo.so we could not set the “TextBoxMode” property to “ReadOnly”.
Is there any posibility to get the item which is going to be deleted (If i got that, then i can control the deletion of disabled item) OR is there any alternate way to handle this without affecting the client requirement. Kindly suggest.
Kindly Provide response for this.
Hai Hans,
The idea suggest by you itself require the item value which is going to be deleted.
currently we have solve this using different logic but it requires database storage and retrival and more coding efforts.This leads to Performance issue when i am using 11 webcombo controls in a page.
I have found some idea from http://doc.evget.com/HelpDocument/WebCombo2013CAB/topic213.html.
This link describes WebCombo Features .In which i had found the below description.
3.Item Deletion :Item deletion can be done using the Delete or Backspace key. WebCombo is capable of identifying tokens in the cursor position and delete the previous item when the Backspace key is pressed, it can also delete the next item if the Delete key is pressed.
If we get the cursor position among the selected items(tokens),then we could find the item which is going to be deleted.Is it possible becase the above highighted line says like that.
using cursor position and key code i can capture the item to be deleted then i will compare that item with webcombo rows to check wheather it is disabled or not.If disabled then i quit the delete function else i let the action to happen.
Please suggest it is possible?. i am waiting for your response.
Hello,
Thank you for the reply.
Yes, it is possible. Like you said, so you should add validation code to compare that item with WebCombo rows to check whether it is disabled or not.
Because by default, WebCombo doesn’t have any feature to check whether the item disabled or not during deletion.
Regards,
Hans K.
One final query. do you have any idea about how to get the cursor position(either client side or server side) among the selected items(tokens) in the textbox object of webcombo.
Hello,I found a blog that show how to get the selection text from textbox.Please try to follow this link.Hope this helps.Regards,Hans K.
or
Choose this if you're already a member of Intersoft Community Forum. You can link your OpenID account to your existing Intersoft Social ID.
Choose this if you don't have an Intersoft account yet. Your authenticated OpenID will be automatically linked to your new Intersoft account.
Enter your Wordpress Blogname