Aspose.Cells.GridWeb getting javascript error


#1

Hi Team,

I have upgraded Aspose.Cells 19.3.0.0 version and Aspose.Cells.GridWeb - 19.3.0.0. using a new JavaScript acwmain.js and in aspx page setup below settings for gridweb tags and its properties. The code was working fine before upgrading Aspose.Cells new version and referring new JavaScript acwmain.js in the code, now after upgrade I am getting error when I am trying to register my grid with page using below code.

JavaScript runtime error: ‘acwmain’ is undefined

ScriptManager.RegisterStartupScript(this.Page, this.GetType(), “temp”, “new acwmain(document.getElementById(‘acWGTemplateField’));”, true);

<acw:GridWeb ID=“acWGTemplateField” runat=“server” Width=“100%” Height=“580px” ShowLoading=“false” ShowContextMenu=“true” EditMode=“false” OnCustomCommand=“acWGTemplateField_CustomCommand”
ShowBottomBar=“False” EnableDoubleClickEvent=“false” OnDoubleClickCellClientFunction=“OnDoubleClickViewAttribute”
XhtmlMode=“True” EnableClientRowOperations=“false” EnableStyleDialogbox=“false”
EnableClientMergeOperations=“false” EnableClientColumnOperations=“false” EnableClientFreeze=“false”
EnableClientResizeColumnRow=“false” ShowSaveButton=“False” ShowSubmitButton=“False”
ShowUndoButton=“False” OnCellSelectedClientFunction=“onCellSelected”>

<acw:CustomCommandButton Command=“InsertC” Text=“Insert Column” CommandType=“ContextMenuItem”></acw:CustomCommandButton>
<acw:CustomCommandButton Command=“DeleteC” Text=“Delete Column” CommandType=“ContextMenuItem”></acw:CustomCommandButton>
<acw:CustomCommandButton Command=“InsertR” Text=“Insert Row” CommandType=“ContextMenuItem”></acw:CustomCommandButton>
<acw:CustomCommandButton Command=“DeleteR” Text=“Delete Row” CommandType=“ContextMenuItem”></acw:CustomCommandButton>

</acw:GridWeb>

Appreciate your help on how to resolve this JavaScript error on page load.


#2

@nileshdhote,

Thanks for the details.

Please provide us Microsoft Visual Studio Project (runnable) replicating the issue using latest resource files of Aspose.Cells.GridWeb v19.3.x. The project should be simplified and it should contain one page (or very few .aspx pages).


#3

Hi Amjad,

I am working from client location and can not upload any sample project here,
I am getting error when I downloaded Aspose.cells 19.3 version from Nuget and copied all acw_client folder files in my current project without adding Aspose.cells.GridWeb 19.3 dll in project and I tried to run the application but got the error JavaScript runtime error: ‘acwmain’ is undefined then I added trial version of Aspose.Cells.GridWeb 19.3 in my project but still I got the same error.

The page was working fine with the Aspose.Cells 7.3.1.0 and Aspose.Cells.GridWeb 2.7.8.2000 versions for IE but was not working for Chrome, hence decided to go for latest version, which is now giving JavaScript runtime error: ‘acwmain’ is undefined error.

I have tried below things

  1. Delete all temporary files
  2. Delete Cache, browsing history.
  3. restart IE with new session.
  4. even after changing “new acwmain(document.getElementById(‘acWGTemplateField’))” to document.getElementById(‘acWGTemplateField’) it was refering acwmain in JavaScript, not sure from where it is picking up the references.
  5. acwmain(document.getElementById(‘acWGTemplateField’)) is the only reference in my code.
  6. Tried to comment ScriptManager.RegisterStartupScript(this.Page, this.GetType(), “temp”, “new acwmain(document.getElementById(‘acWGTemplateField’));”, true); this line but still somewhere code is referring acwmain object.
  7. I have checked acwmain.js for acwmain function and found only declaration but no use of that function.

Please let know how to proceed further. Your help is much appreciated.


#4

@nileshdhote,

I tested Aspose.Cell.GridWeb v19.3.x with its latest resource files (acw_client folder) in a simple project and it works fine and I could not find your mentioned issue. I am afraid, we need a simulation project to reproduce the issue on our end, so we could log and investigate the issue and to figure it out soon. Could you reproduce the issue in a separate and simple project using Aspose.Cells.GridWeb v19.3.x (with latest resource files). If so, kindly do share the project, we will check it soon.

By the way, did you embed some settings in web.config file in your project, this is important. Check the path of acw_client directory which is necessary for GridWeb to work. It contains the acwmain.js and other resource files which are important for Aspose.Cells.GridWeb to work properly. For example, you may add a folder named grid in your project and then add the acw_client directory (you may copy it from your your installation directory, e.g “…Aspose\Aspose.Cells for .NET”). Now add the following lines to web.config file:
i.e.,

<appSettings>
<add key="aspose.cells.gridweb.acw_client_path" value="grid/acw_client/"/>
<add key="aspose.cells.gridweb.force_script_path" value="true"/>
<add key="aspose.cells.gridweb.forcepath" value="true"/>
</appSettings>
.....

#5

Hi Amjad,

thanks for your reply, I have these settings on added in my web.config. acw_client folder was added in my project root level.

<add key="aspose.cells.gridweb.acw_client_path" value="/acw_client/" />
<add key="aspose.cells.gridweb.force_script_path" value="true" />
<add key="aspose.cells.gridweb.forcepath" value="true" />
<!-- Aspose cells keys end -->

As I told that aspose.cells.gridweb was working fine with the Aspose.Cells 7.3.1.0 and Aspose.Cells.GridWeb 2.7.8.2000 versions for IE but was not working for Chrome.

After I installed new version of the Aspose.cells and Aspose.cells.gridweb 19.3.0, the application started throwing error.

One interesting thing even If I remove ScriptManager.RegisterStartupScript(this.Page, this.GetType(), “temp”, “new acwmain(document.getElementById(‘acWGTemplateField’));”, true); this line not sure from where it is giving JavaScript runtime error: ‘acwmain’ is undefined error on new acwmain(document.getElementById(‘acWGTemplateField’)); line. now I have reverted the code to old version but still it is giving same error.


#6

@nileshdhote,

We are very sorry but we do not have any clue why you are getting this error/exception. We did evaluate the issue using latest version (with latest resource files) but could not find any issue. May be the acwmain.js file is corrupted in your environment. It is also possible that the acwmain.js was lost in your environment. Anyways, we are not entirely sure about your issue. I am afraid, we need a separate sample project (runnable) to analyse your issue. So, kindly create a separate and simple project using Aspose.Cells.GridWeb v19.3.x (with latest resource files) and share the project, we will check it soon.


#7

Thanks Amjad for your reply,

uploading sample project from client environment is not possible, Let me reproduce issue in a sample project. Please keep this thread open till further updates from my side.

Really appreciate your spport