Class SortSpec
با مجموعهها، منظم بمانید
ذخیره و طبقهبندی محتوا براساس اولویتهای شما.
مرتب سازی مشخصات مشخصات مرتب سازی
مستندات دقیق
get Background Color()
رنگ پسزمینه مورد استفاده برای مرتبسازی را برمیگرداند، یا در صورت عدم وجود، null
برمیگرداند.
بازگشت
Color
- رنگ پس زمینه.
مجوز
اسکریپت هایی که از این روش استفاده می کنند نیاز به مجوز با یک یا چند مورد از حوزه های زیر دارند:
-
https://www.googleapis.com/auth/spreadsheets.currentonly
-
https://www.googleapis.com/auth/spreadsheets
get Data Source Column()
ستون منبع داده را دریافت می کند که مشخصات مرتب سازی روی آن اعمال می شود. اگر این مشخصات مرتبسازی روی ستون منبع داده عمل نکند، null
برمیگرداند.
بازگشت
Data Source Column
- ستون منبع داده که مشخصات مرتب سازی روی آن اعمال می شود.
مجوز
اسکریپت هایی که از این روش استفاده می کنند نیاز به مجوز با یک یا چند مورد از حوزه های زیر دارند:
-
https://www.googleapis.com/auth/spreadsheets.currentonly
-
https://www.googleapis.com/auth/spreadsheets
get Dimension Index()
اگر به فیلتر محلی پیوند داده نشده باشد، نمایه ابعاد یا null
را برمیگرداند.
بازگشت
Integer
- شاخص بعد.
مجوز
اسکریپت هایی که از این روش استفاده می کنند نیاز به مجوز با یک یا چند مورد از حوزه های زیر دارند:
-
https://www.googleapis.com/auth/spreadsheets.currentonly
-
https://www.googleapis.com/auth/spreadsheets
get Foreground Color()
رنگ پیشزمینه مورد استفاده برای مرتبسازی را برمیگرداند، یا اگر وجود نداشته باشد، null
برمیگرداند.
بازگشت
Color
- رنگ پیش زمینه
مجوز
اسکریپت هایی که از این روش استفاده می کنند نیاز به مجوز با یک یا چند مورد از حوزه های زیر دارند:
-
https://www.googleapis.com/auth/spreadsheets.currentonly
-
https://www.googleapis.com/auth/spreadsheets
get Sort Order()
ترتیب مرتب سازی را برمی گرداند.
بازگشت
Sort Order
- ترتیب مرتب سازی.
مجوز
اسکریپت هایی که از این روش استفاده می کنند نیاز به مجوز با یک یا چند مورد از حوزه های زیر دارند:
-
https://www.googleapis.com/auth/spreadsheets.currentonly
-
https://www.googleapis.com/auth/spreadsheets
is Ascending()
آیا ترتیب مرتب سازی صعودی است یا خیر.
بازگشت
Boolean
- اگر ترتیب مرتب سازی صعودی باشد true
یا در غیر این صورت false
.
مجوز
اسکریپت هایی که از این روش استفاده می کنند نیاز به مجوز با یک یا چند مورد از حوزه های زیر دارند:
-
https://www.googleapis.com/auth/spreadsheets.currentonly
-
https://www.googleapis.com/auth/spreadsheets
جز در مواردی که غیر از این ذکر شده باشد،محتوای این صفحه تحت مجوز Creative Commons Attribution 4.0 License است. نمونه کدها نیز دارای مجوز Apache 2.0 License است. برای اطلاع از جزئیات، به خطمشیهای سایت Google Developers مراجعه کنید. جاوا علامت تجاری ثبتشده Oracle و/یا شرکتهای وابسته به آن است.
تاریخ آخرین بهروزرسانی 2025-07-24 بهوقت ساعت هماهنگ جهانی.
[null,null,["تاریخ آخرین بهروزرسانی 2025-07-24 بهوقت ساعت هماهنگ جهانی."],[[["\u003cp\u003e\u003ccode\u003eSortSpec\u003c/code\u003e defines the specifications for sorting data, such as sort order, colors, and the data source.\u003c/p\u003e\n"],["\u003cp\u003eIt provides methods to retrieve information about the sort specification, including background and foreground colors, sort order, and the data source column being used.\u003c/p\u003e\n"],["\u003cp\u003eYou can determine if the sort order is ascending using the \u003ccode\u003eisAscending()\u003c/code\u003e method and obtain the dimension index with \u003ccode\u003egetDimensionIndex()\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eAll methods within \u003ccode\u003eSortSpec\u003c/code\u003e require authorization with specific scopes related to spreadsheet access.\u003c/p\u003e\n"]]],["SortSpec defines the criteria for sorting data. Key actions include retrieving the background and foreground colors used in sorting, if any. It fetches the data source column being sorted, or returns null if not present. It can retrieve the dimension index if linked to a filter. The sort order itself, along with whether the sorting is ascending, can also be obtained using the methods `getSortOrder()` and `isAscending()` respectively.\n"],null,["# Class SortSpec\n\nSortSpec\n\nThe sorting specification. \n\n### Methods\n\n| Method | Return type | Brief description |\n|-------------------------------------------------|---------------------------------------------------------------------------|------------------------------------------------------------------------|\n| [getBackgroundColor()](#getBackgroundColor()) | [Color](/apps-script/reference/spreadsheet/color) | Returns the background color used for sorting, or `null` if absent. |\n| [getDataSourceColumn()](#getDataSourceColumn()) | [DataSourceColumn](/apps-script/reference/spreadsheet/data-source-column) | Gets the data source column the sort spec acts on. |\n| [getDimensionIndex()](#getDimensionIndex()) | `Integer` | Returns the dimension index or `null` if not linked to a local filter. |\n| [getForegroundColor()](#getForegroundColor()) | [Color](/apps-script/reference/spreadsheet/color) | Returns the foreground color used for sorting, or `null` if absent. |\n| [getSortOrder()](#getSortOrder()) | [SortOrder](/apps-script/reference/spreadsheet/sort-order) | Returns the sort order. |\n| [isAscending()](#isAscending()) | `Boolean` | Returns whether the sort order is ascending. |\n\nDetailed documentation\n----------------------\n\n### `get``Background``Color()`\n\nReturns the background color used for sorting, or `null` if absent.\n\n#### Return\n\n\n[Color](/apps-script/reference/spreadsheet/color) --- The background color.\n\n#### Authorization\n\nScripts that use this method require authorization with one or more of the following [scopes](/apps-script/concepts/scopes#setting_explicit_scopes):\n\n- `https://www.googleapis.com/auth/spreadsheets.currentonly`\n- `https://www.googleapis.com/auth/spreadsheets`\n\n*** ** * ** ***\n\n### `get``Data``Source``Column()`\n\nGets the data source column the sort spec acts on. Returns `null` if this sort spec is\nnot acting on a data source column.\n\n#### Return\n\n\n[DataSourceColumn](/apps-script/reference/spreadsheet/data-source-column) --- The data source column the sort spec acts on.\n\n#### Authorization\n\nScripts that use this method require authorization with one or more of the following [scopes](/apps-script/concepts/scopes#setting_explicit_scopes):\n\n- `https://www.googleapis.com/auth/spreadsheets.currentonly`\n- `https://www.googleapis.com/auth/spreadsheets`\n\n*** ** * ** ***\n\n### `get``Dimension``Index()`\n\nReturns the dimension index or `null` if not linked to a local filter.\n\n#### Return\n\n\n`Integer` --- The dimension index.\n\n#### Authorization\n\nScripts that use this method require authorization with one or more of the following [scopes](/apps-script/concepts/scopes#setting_explicit_scopes):\n\n- `https://www.googleapis.com/auth/spreadsheets.currentonly`\n- `https://www.googleapis.com/auth/spreadsheets`\n\n*** ** * ** ***\n\n### `get``Foreground``Color()`\n\nReturns the foreground color used for sorting, or `null` if absent.\n\n#### Return\n\n\n[Color](/apps-script/reference/spreadsheet/color) --- The foreground color.\n\n#### Authorization\n\nScripts that use this method require authorization with one or more of the following [scopes](/apps-script/concepts/scopes#setting_explicit_scopes):\n\n- `https://www.googleapis.com/auth/spreadsheets.currentonly`\n- `https://www.googleapis.com/auth/spreadsheets`\n\n*** ** * ** ***\n\n### `get``Sort``Order()`\n\nReturns the sort order.\n\n#### Return\n\n\n[SortOrder](/apps-script/reference/spreadsheet/sort-order) --- The sort order.\n\n#### Authorization\n\nScripts that use this method require authorization with one or more of the following [scopes](/apps-script/concepts/scopes#setting_explicit_scopes):\n\n- `https://www.googleapis.com/auth/spreadsheets.currentonly`\n- `https://www.googleapis.com/auth/spreadsheets`\n\n*** ** * ** ***\n\n### `is``Ascending()`\n\nReturns whether the sort order is ascending.\n\n#### Return\n\n\n`Boolean` --- `true` if the sort order is ascending, or `false` otherwise.\n\n#### Authorization\n\nScripts that use this method require authorization with one or more of the following [scopes](/apps-script/concepts/scopes#setting_explicit_scopes):\n\n- `https://www.googleapis.com/auth/spreadsheets.currentonly`\n- `https://www.googleapis.com/auth/spreadsheets`"]]