Does not work with 1.6
I get "Cannot find module "itRequestsStrings" (it is in mystrings.d.ts) If I rem the "import * as strings from 'itRequestsStrings';" I get "Property 'dataTable' does not exist on type 'JQuery<HTMLElement>'. Did you mean 'DataTable'"
Document Details
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.
- ID: b56fb9ec-59c2-413f-eaa2-e84abfb30211
- Version Independent ID: ca610020-3018-fd78-1da5-7f00fed5b04f
- Content: Migrate jQuery and DataTables solution built using Script Editor web part to SharePoint Framework
- Content Source: docs/spfx/web-parts/guidance/migrate-jquery-datatables-script-to-spfx.md
- Product: sharepoint
- GitHub Login: @spdevdocs
- Microsoft Alias: spdevdocs
The dataTable mean DataTable from jquery.dataTables.min js, we do not need to change it. What you need is change the itRequestsStrings after creating the project( Keep Names consistent between importing and exporting).
Note: you maybe need to run **npm i jquery** and **npm i moment**.
I run SPFx 1.6 and follow the docs, every thing is OK. Before running the code, donot forget to create the list "IT Requests"
With spfx 1.7, I got the following with both ItRequestsWebPart.ts and moment-plugin.ts. "error TS2339: Property 'render' does not exist on type '(param?: Settings) => DataTable'.
In stage: Transform the plain JavaScript code to TypeScript, changed code to ($.fn.DataTable as any).render.moment('YYYY/MM/DD'). Got runtime error:
ItRequestsWebPart.ts:72 Uncaught (in promise) TypeError: Cannot read property 'render' of undefined at ItRequestsWebPart.render (ItRequestsWebPart.ts:72) at ItRequestsWebPart.t._renderWithAccessibleTitle (sp-webpart-workbench-assembly_en-us_cee2ed9196d873e2374ab4945906bf2a.js:577) at sp-webpart-workbench-assembly_en-us_cee2ed9196d873e2374ab4945906bf2a.js:577
Closing issue as "answered". If you encounter similar issue(s), please open up a NEW issue. Thank you.
Issues that have been closed & had no follow-up activity for at least 7 days are automatically locked. Please refer to our wiki for more details, including how to remediate this action if you feel this was done prematurely or in error: Issue List: Our approach to locked issues