עבור לתוכן
View in the app

A better way to browse. Learn more.

HWzone

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

בעיה בקובץ json המרה מנתונים של טבלה לאובייקט ג'יסון

Featured Replies

פורסם

זה הקובץ גייסון שלי



[
{
"FirstName": "ufjgf",
"LastName": "total"
},
{}
]

כל פעם הוא מוסיף לי בסוף האובייקט סוגריים מסולסלים ריקים מה שבעצם מוסיף לי אובייקט ריק לרשימה

איך אני מנקה את הקובץ?

זה הקוד שהופך את האובייקט לאובייקט ג'יסון



$("#SaveFile").on("click", function () {
var cols = $("#myTable thead tr th").map(function () {


return $(this).text();
})


var tableObjects = $("#usertable tr").map(function (i) {
row = {};
var headers = cols;
$(this).find("td").each(function (i) {


var rowName = headers[i];
row[rowName] = $(this).text();
})

var td = $(row).find('td:empty');
if (td.length > 0) $(this).remove();
return row;
}).get();


PersonWebService.Save(tableObjects);


});



  • 2 שבועות מאוחר יותר...
פורסם

תוכל להראות את הקוד HTML של הטבלה?

פורסם
  • מחבר

זה בסדר פתרתי את זה בסוף הבעיה הייתה שהפונקצית jquery שעשיתי לא הייתה תקינה ואז הוא הכניס לי כל פעם 2 אובייקטים, אחד את האובייקט הרצוי ועוד אחד ריק :)

מזל שאלוהים ברא את הדיבגר של גוגל חחחח

ארכיון

דיון זה הועבר לארכיון ולא ניתן להוסיף בו תגובות חדשות.

דיונים חדשים

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.